Skip to content Skip to main navigation Skip to footer

Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, esign.Document After Installing 1.74 and above

If you are getting the following error or similar when trying to Send for Signature on the Signature Preview page using Opero Documents:

Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, esign.Document: execution of AfterInsert caused by: esign.Template.TemplateException: Target ids passed do not contain necessary id for object type ‘opportunity’. Class.esign.Template: line 96, column 1 Class.esign.Template: line 48, column 1 Class.esign.TriggerSendSignatureEmail: line 71, column 1 Class.esign.TriggerSendSignatureEmail: line 26, column 1 Class.esign.StandardTriggerBehaviour: line 24, column 1 Trigger.esign.Document: line 2, column 1: []

To fix this you will need to add the Lookup fields to the layout of the new Lightning page that you are related from the Document Action. Go to the Salesforce Setup> Object manager> eSign Doc. Then on the left panel click on “Field Sets”. Open the “Send Document Custom Fields” and add the Lookup field to the layout.