簡體   English   中英

在Salesforce Lightning中自定義“使用Docusign發送”

[英]Customize “Send With Docusign” in Salesforce Lightning

通過在SF Classic中設置CRL參數,我能夠使用javascript按鈕預填充收件人列表。

現在我想在Lightning中實現同樣的目標。 我嘗試創建一個VF頁面,將用戶重定向到dsfs__DocuSign_CreateEnvelope頁面並添加所需的ur參數(很像JS按鈕)。 它部分工作 - 它預先填充收件人列表,它允許發送電子郵件。 但最終拋出一個錯誤:“ 沒有為受控的dsfs.EnvelopeController生成Javascript代理:可能不會在iframe中使用公共遠程方法

在閃電中實現這種功能的正確方法是什么? 它甚至可能嗎?

更新:VF頁面:

<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>

控制器:

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;';
    }
}

提前致謝

經過一些研究,您可能必須使您的遠程操作方法全局化。 介意發布您的VF頁面代碼?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM