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?
a0H
is not the proper key prefix of whatever lookup field you are trying to populate. That said, stuffing id values into text fields is not best practice. Instead, your PB should delegate work to Flow for record creation as Flow can do queries to find related records