I have a custom JS button in SF Classic that is used to send documents to Docusign, and I’ve successfully replicated the button in a Skuid snippet:
var params = argumentst0],
$ = skuid.$; var model = skuid.model.getModel(‘UltrasoundRecord’); var ClientUltrasound = skuid.model.getModel(‘UltrasoundRecord’).getFirstRow(); //Docusign Options Setup var CRL=‘Email~’+ ClientUltrasound.Medical_Director_Email__c +‘;Role~Medical Director;AccessCode~’+ClientUltrasound.Clinic_Ultrasound_Password__c+‘;FirstName~’+ClientUltrasound.Medical_Director_First_Name__c+‘;LastName~’+ClientUltrasound.Medical_Director_Last_Name__c; var DST=‘*******************************’; //Omitted var CEM= ClientUltrasound.Ultrasound_Note_to_MD__c; var CES=ClientUltrasound.Ultrasound_Email_Subject__c; var url = ‘/apex/dsfs__DocuSign_CreateEnvelope?xSourceID=’ + ClientUltrasound.Id + ‘]&CRL=’+CRL+‘&DST=’+DST+‘&CEM=’+CEM+‘&CES=’+CES; console.log('Merged URL: ’ + url); window.open(url.text());
The URL merges all the values correctly, however, due to the Docusign Visualforce pages enforcing CSRF…I get this errror on the resulting page:
The link you followed isn’t valid. This page requires a CSRF confirmation token. Report this error to your Salesforce administrator.I know how to fix this using { !URLFOR() } in Visualforce/Apex, but I’m at a loss for how to implement it in Skuid/JS. How can I get the correct URL for a CSRF protected Visualforce page in a Skuid snippet?
Appreciate the assist!