Powerforms提交后获取DocuSign信封ID及Salesforce关联问题
解答DocuSign PowerForms与Salesforce Community集成的信封关联问题
Hey there, let's walk through your two questions step by step—this is a super common integration scenario, so I’ve got you covered:
1) 从PowerForms页面重定向时,是否可获取DocuSign信封ID?
Absolutely! DocuSign makes this straightforward with merge field parameters in your PowerForm's redirect URL setup. Here's how it works:
- When configuring your PowerForm, head to the redirect settings (usually under "Post-Submission Actions").
- In the redirect URL, add the
{{envelopeId}}merge variable as a query parameter. For example, your URL might look like:/s/community-redirect-page?envelopeId={{envelopeId}} - Once a user completes the PowerForm, DocuSign will automatically replace
{{envelopeId}}with the actual unique ID of the created envelope before redirecting the user. - On the Salesforce Community side, you can grab this ID using Apex (if you're using a custom controller) like this:
Or if you're using LWC, you can pull it from theString envelopeId = ApexPages.currentPage().getParameters().get('envelopeId');currentPageReference's parameters.
2) 若可获取,能否借助标准AppExchange包在Salesforce中插入含该ID的DocuSign信封记录,以此建立信封与Salesforce记录的关联?
You bet! The official DocuSign eSignature for Salesforce AppExchange package is built exactly for this kind of use case. Here's what you need to do:
- First, make sure you’ve installed the latest version of the official DocuSign package and completed the initial setup (like connecting your DocuSign account to Salesforce via OAuth or an integration key).
- Once you have the envelope ID, you can create a
dsfs__Envelope__crecord in Salesforce via Apex. Here's a quick example snippet:dsfs__Envelope__c newEnvelope = new dsfs__Envelope__c( dsfs__EnvelopeId__c = envelopeId, // The ID you grabbed from the redirect dsfs__RelatedId__c = '001XXXXXXXXXXXX', // ID of your target Salesforce record (e.g., Opportunity, Contact) dsfs__Status__c = 'Sent' // You can sync the actual status via DocuSign API if needed ); insert newEnvelope; - Bonus: The DocuSign package includes built-in Apex classes (like
dsfs.DocuSignAPI) that let you fetch additional envelope details (signers, status updates) to keep your Salesforce record in sync. You can even set up a scheduled job or trigger to pull the latest envelope status automatically. - Don’t forget to check permissions: Make sure your Community users (or the integration user running this code) have CRUD access to the
dsfs__Envelope__cobject and its fields, otherwise you’ll run into permission errors.
内容的提问来源于stack exchange,提问作者Michael Dill
相关产品推荐
相关产品推荐

