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
Roberto CialfiRoberto Cialfi 

Lookup field on cases auto-populate

Hi Guys, I hope you can help me.
I have a custom object called "Change Request" that need approval. When a Change Request is approved, a process - developed with process builder - creates a Case with the information in the change request. I then have a lookup field to cases called "Related Case" in the Change request object to link the two. However, I would like this field to out populate. Is this possible? how?
Thank you, Rob
 
Kaj E. PetersenKaj E. Petersen
Hi Roberto,

You have a few choices to solve your issue.  

1. (My preferred) Use Flow to create your Case and update the Id on the Change request.   Within Flow, you can get the Id of the record created and use it to update your current object.  Then update your current process builder to use that Flow.  As far as I know, there is no such option in Process Builder. 
2. If the Change Request Id is on the Case, then can create a second process builder to update the id back on the Change Request object based on the Case creation.  This is less rework but can be harder to maintain.  
3. You can use an Apex Trigger or Apex code invoked from process builder, but I would only suggest this if you have some hard calculations. I try and steer people away from Apex if process builder and flow can be used.  

Warning:  Be sure the selection criteria on the process builder will prevent from processing the Change Request several times.