Is it possible to populate a lookup field with Process builder when it is creating a record?
A NPR record must be created by the process builder if the Contract status changes to a certain value.
The process should be like this:
The Contract status changes -> an NPR record is created (the NPR is linked to a Project record). I want to populate the Project Lookup on the NPR with a value coming from Contact-> Opportunity -> Project.
I tried using the record id field, Project Name, a custom text field on the Project that contains the id from the project … but I keep getting an error:
"You encountered some errors when trying to save this record
We can't save this record because the “NPR – create new NPR based on Contract Status” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to create records: FIELD_INTEGRITY_EXCEPTION: Project Name: id value of incorrect type: a0H2a0000042BkgEAE. You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 1360218809-19989 (688504257)"
Did I do something wrong?
Best Answer
From the hierarchy mentioned in your question, it seems Process builder alone will not be enough to fetch the
Project
lookup for you, since you will need to go back toContact --> Opportunity --> Project
to get that which will require querying the data (as mentioned in the comments by @cropredy)A typical flow (algorithm) would be
contact
update, as you are already doing, and leave theProject
lookup blank.flow
and create an autolaunch flowProject
lookup with the Id fetched from above step to NPR variable