Hello @pankaj727,
EFS (EFS = eSignature For Salesforce) and the DET (DET = Docusign Envelope Template) work differently from when using Apex. Since the EFS process relies on the eSignature process and Docusign settings, SF commands such as ORDER BY do not apply. If you would like to use anchor text or EFS to apply the fields, you cannot determine the order the related list fields are applied, because you cannot set this. However, there is a workaround using a server template and placing fields where you can determine the order. The process would have to be created something similar to the following:
Create Docusign Server Template:
- Log in to Docusign and go to My Preferences > Template matching.
- Set the sensitivity to 80% and enable Match on page level.
- Choose the have Manually add the template matching to make it easier for testing.
- Tip: Once you test and confirm the process works, you should also enable Apply template automatically under the Template Matching settings.
- Create the server template by going to the Templates tab, locating the desired envelope template, and copying it.
- Rename the template and upload the Gen template Word file with the Gen anchor statements.
- Important: Ensure the documents added to the Gen template are the same documents uploaded to the server template. The document order does not matter, but the number of pages must match.
- Select Next, add the desired eSignature Conditional Logic fields, and select Save and Close.
- Test the template before deploying it.
Result
This workaround provides the following user experience:
- The user goes to the Salesforce record and selects the Docusign Gen button.
- Docusign Gen generates the document following the template configuration, and the user selects Send with Docusign.
- The envelope template configuration applies to the envelope (i.e. Recipients, Writeback Settings, etc.).
- The user goes to the Prepare and Send section and selects the tab or Next button.
- They are brought into the tagging screen where the server template settings apply the conditional logic/eSignature fields to the envelope documents via the template matching settings.
- The user reviews everything and sends the envelope.
I hope I answered your question. Thank you!
Regards,
Melanie | Docusign Community Moderator