简体   繁体   中英

Customize “Send With Docusign” in Salesforce Lightning

I was able to pre-populate recipients list using javascript button by setting CRL parameter in SF Classic.

Now I would like to achieve the same in Lightning. I tried creating a VF page that would redirect user to dsfs__DocuSign_CreateEnvelope page and add desired ur parameters (much like in JS button). It partly works - it pre-populates recipients list, it allows to send the email. But finally throws an error: " Javascript proxies were not generated for controlled dsfs.EnvelopeController: may not use public remoted methods inside an iframe "

What is the proper way to achieve such functionality in lightning? Is it even possible?

UPDATE: VF Page:

<apex:page standardController="Opportunity"
    extensions="CTRL_DocusignRedirect"
    sidebar="false"
    showHeader="false"
    action="{!autoRun}"
>
    <apex:sectionHeader title="DocuSign"/>

    <apex:outputPanel >
        You tried calling an Apex Controller from a button.
        If you see this page, something went wrong.
        Please notify your administrator.
    </apex:outputPanel>

</apex:page>

Controller:

global class CTRL_DocusignRedirect
{

    private static final STRING PARAM_DSEID = 'DSEID';
    private static final STRING PARAM_SOURCE_ID = 'SourceID';
    private static final STRING PARAM_CRL = 'CRL';

    private Opportunity anOpportunity = null;

    public CTRL_DocusignRedirect(ApexPages.StandardController stdController)
    {
        Id opportunityId = stdController.getRecord().Id;
        this.anOpportunity = DAL_Opportunity.getById(opportunityId);
    }

    public PageReference autoRun()
    {
        if (this.anOpportunity == null)
        {
            return null;
        }
        PageReference pageRef = Page.dsfs__DocuSign_CreateEnvelope;
        pageRef.getParameters().put(PARAM_DSEID, '0');
        pageRef.getParameters().put(PARAM_SOURCE_ID, this.anOpportunity.Id);
        pageRef.getParameters().put(PARAM_CRL, this.getCRL());
        pageRef.setRedirect(true);
        return pageRef;
    }

    private String getCRL()
    {
        return 'Email~' + anOpportunity.Payer_Email__c +
                ';FirstName~' + anOpportunity.Payer_First_Name__c +
                ';LastName~' + anOpport`enter code here`unity.Payer_Last_name__c +
                ';RoutingOrder~1;Role~Pay`enter code here`er;';
    }
}

Thanks in advance

After some research, you may have to make your remote action method global. Mind posting your VF page code ?

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