function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
emandra_kfemandra_kf 

Lookup Fields with Record Create

Is it possible to include Lookup fields with a Record Create? I know that one cannot update lookup fields with a Field Update action on a Workflow Rule, but I was hoping Visual Workflow would offer something new. 

 

If it does not, is the solution to write an Apex plug-in component?

 

Thanks.

Best Answer chosen by Admin (Salesforce Developers) 
markross__cmarkross__c

It is absolutely possible! I do it all the time using the desktop Flow Designer, and I'm 99% sure you can with the cloud Flow Designer as well. The trick is that you have to send the record's ID to the field on the Record Create, instead of its value.

For example, if you wanted to add the contact Eskarina Smith to a lookup contact field, you would not pass it the data "Eskarina Smith"; you would instead pass it "0037000000dY30p" or whatever the record's ID is. You can usually get this via a preceding data lookup by pulling the data from some kind of field ideally called "Id" or something like it.

All Answers

markross__cmarkross__c

It is absolutely possible! I do it all the time using the desktop Flow Designer, and I'm 99% sure you can with the cloud Flow Designer as well. The trick is that you have to send the record's ID to the field on the Record Create, instead of its value.

For example, if you wanted to add the contact Eskarina Smith to a lookup contact field, you would not pass it the data "Eskarina Smith"; you would instead pass it "0037000000dY30p" or whatever the record's ID is. You can usually get this via a preceding data lookup by pulling the data from some kind of field ideally called "Id" or something like it.

This was selected as the best answer
RajaramRajaram

Yes, as GetForcedQ said, you can query the lookup field and the value will be the ID.

emandra_kfemandra_kf

Thank you very much - that worked perfectly.

markross__cmarkross__c

No problem! Feel free to chip in by marking the post as the Solution! Thanks!