Customize “Send With Docusign” in Salesforce Lightning

狂风中的少年 提交于 2019-12-06 14:27:56

问题


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

来源:https://stackoverflow.com/questions/43317136/customize-send-with-docusign-in-salesforce-lightning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!