首页 > 解决方案 > 集成 Salesforce 与 Docusign 无效类型:dfsle.Envelope

问题描述

我正在尝试将 Salesforce 与 DocuSign 与 Docusign Apex 工具包集成,但我的组织中没有 dfsle 类。我安装了 Apex 工具包(https://developers.docusign.com/docs/salesforce/how-to/apex-toolkit-install/

Id MySourceId = '00Q0m00000884XXXXX';

dfsle.Envelope myEnvelope = dfsle.EnvelopeService.getEmptyEnvelope(new dfsle.Entity(mySourceId));

Lead myContact = [SELECT Id, Name, Email FROM lead where id = '00Q0m00000884XXXX'];

//use the Recipient.fromSource method to create the Recipient
dfsle.Recipient myRecipient = dfsle.Recipient.fromSource(
            myContact.Name, // Recipient name
            myContact.Email, // Recipient email
            null, //Optional phone number
            'Signer 1', //Role Name. Specify the exact role name from template
            new dfsle.Entity(myContact.Id)); //source object for the Recipient


dfsle.UUID myTemplateId = dfsle.UUID.parse('28386dbc-2576-4637-bb77-c86938fe080f');

//create a new document for the Envelope
dfsle.Document myDocument = dfsle.Document.fromTemplate(
    myTemplateId, // templateId in dfsle.UUID format
    'Self Sales Teste'); // name of the template

// Send the envelope.
myEnvelope = dfsle.EnvelopeService.sendEnvelope(
    myEnvelope, // The envelope to send
    true); // Send now?


try {
    dfsle.EnvelopeService.sendEnvelope(envelope, true);
} catch (dfsle.APIException ex) {
    if (ex.error.code == dfsle.APIErrorCode.CONSENT_REQUIRED) {
        // user is a valid member of the DocuSign account, but has not granted consent to this application 
    } else {
        // handle other errors
    }
}
Error: Line: 3, Column: 1
Error: Invalid type: dfsle.Envelope

标签: salesforcedocusignapi

解决方案


几周前有同样的问题 :) 转到您的 Salesforce 设置。在快速查找框中键入已安装的软件包。确保已安装 DocuSign 应用程序启动器。检查包前缀。


推荐阅读