You need to sign in to do that
Don't have an account?
Steve Cairney NOW
Trigger that will pull the Record ID of a distant object based on the record name to create lookup relationship
Hi, I'm trying to fill out lookup relationship field on one object using the name (auto number) of another.
I've tried process builder but I don't think it's possible so I'm thinking a trigger is whats needed.
Example,
The main object is called Patient__c has each record will have a name such as PAT-1234
The second object is called Prescription__c and using API (not my department) and that has lookup field for Patient__c and a field called SFPatientREF__c which is filled in PAT-1234. This is done on insert with the API
To connect the two, I need to popute the look up field with the ID of PAT-1234 so would it be possible to pull this into a feild called SFPatientID__c and have process builder to the rest?
I've tried process builder but I don't think it's possible so I'm thinking a trigger is whats needed.
Example,
The main object is called Patient__c has each record will have a name such as PAT-1234
The second object is called Prescription__c and using API (not my department) and that has lookup field for Patient__c and a field called SFPatientREF__c which is filled in PAT-1234. This is done on insert with the API
To connect the two, I need to popute the look up field with the ID of PAT-1234 so would it be possible to pull this into a feild called SFPatientID__c and have process builder to the rest?
Please try the below code. I hope it will work.