0

I am using Docusign V7.0+ in Salesforce. I want to redirect to the docusign page through lightning component while clicking on the button. Below is the javascript which I need to use that in lightning component.

 {!URLFOR('/apex/dsfs__DocuSign_CreateEnvelope', null, [
SourceID = PPME_PreEmployment__c.Id

]
)}
0

The standard way to redirect to URL is by using e.force:navigateToURL event in lightning controller. Below is the code snippet.

Component:

<lightning:button label="DocuSign" onlick="{!c.gotoURL}" />

Lightning Controller JS:

({
    gotoURL : function(component, event, helper) {
        helper.gotoURL(component);
    }
})

Lightning Helper JS:

({
        gotoURL : function (component) {
            var urlEvent = $A.get("e.force:navigateToURL");
            urlEvent.setParams({
              "url": "/apex/dsfs__DocuSign_CreateEnvelope?SourceID = "+PPME_PreEmployment__c.Id
            });
            urlEvent.fire();
        }
})
1
  • We have tried with your above suggestion. But its show the below message "The link you followed isn’t valid. This page requires a CSRF confirmation token. Report this error to your Salesforce administrator." – RajDevBsc Sep 25 '19 at 7:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.