简体   繁体   中英

How to remove hard returns from DocuSign JavaScript to create a Salesforce custom button

Please excuse my ignorance, I'm only a beginner at coding and find this very confusing.

I am looking at creating a custom button for DocuSign for Salesforce.

I do have the code provided by DocuSign however they say that it won't work unless I remove the “hard returns”

Can someone help me understand how to do that taking in consideration that I cannot code?

I have tried to paste the code below but it didn't work otherwise here's the link where it can be found. Happy to pay for the advice!

https://support.docusign.com/guides/dfs-admin-guide-sample-js-code-custom-buttons

The syntax for these buttons depends on your current Salesforce setup. The article you've linked is for an older DocuSign for Salesforce custom button that would need to be used in the classic experience on an Execute JavaScript trigger.

Pending on your eSignature for Salesforce package version, this may not work for you. On closer inspection, this button code is meant for a previous version (DocuSign for Salesforce < V7.0, using the Classic Salesforce Experience.

After version 7, and due to security concerns, you may see any error regarding a CSRF token, which means you'll want to use button code in a {!URLFor()} format.

Example:

{!URLFOR('/apex/dsfs__DocuSign_CreateEnvelope', null, [
SourceID = Opportunity.Id,
CCRM = 'Decision Maker~Signer 1',
CCTM = 'Decision Maker~Signer',
DST = 'a2e2cd02-f11e-4c8c-a830-c9f2b6564a9e',
LA = '0',
LF = '0',
OCO = 'Tag'
]
)}

Now, if you've moved onto Salesforce Lightning, we have a feature built into the UI that's made to design these buttons for you via a point / click interface.

I've taken a look at the example you've provided, and it appears to be mislabeled. I've reached out to our Support team to have the article updated. In the meantime, have a look at https://support.docusign.com/en/articles/DFS-URL-buttons-for-Lightning-basic-setup-limitations -- this outlines much of what I've included in my reply and has multiple examples that should help get you started. Let me know if you have additional questions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM