【问题标题】:Docusign Unable to Update Form Fields or Custom Fields in Template DocumentDocusign 无法更新模板文档中的表单字段或自定义字段
【发布时间】:2020-02-08 00:53:53
【问题描述】:

我正在尝试更新模板附加文档中的字段。我尝试使用以下代码更新自定义字段,但无法看到发送给用户的文档的任何更改。是否可以通过编程方式更改模板中的自定义字段?

 TemplateRole tRole = new TemplateRole
            {
                Email = "senderemailid@gmail.com",
                Name = "ABHAY DHAR",
                RoleName = "Test1"
            };

            tRole.Tabs = new Tabs();
            tRole.Tabs.TextTabs = new List<Text>();
            Text textTab = new Text();
            textTab.TabLabel = "Dummy_Custom";
            textTab.Value = "RedPlanetNote2";
            tRole.Tabs.TextTabs.Add(textTab);


            List<TemplateRole> rolesList = new List<TemplateRole>() { tRole };

            // add the role to the envelope and assign valid templateId from your account
            envDef.TemplateRoles = rolesList;
            envDef.TemplateId = "964300cb-9ccf-471f-8d9d-5ad894e8d99f";
           // envDef.CustomFields = docCustomFields;
            // set envelope status to "sent" to immediately send the signature request
            envDef.Status = "sent";

            // |EnvelopesApi| contains methods related to creating and sending Envelopes (aka signature requests)
            EnvelopesApi envelopesApi = new EnvelopesApi();
            EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(accountId, envDef);

【问题讨论】:

  • 你解决了吗?
  • 对不起,我没能解决,当时SDK不支持更新自定义字段。下面的答案证实了这一点。

标签: docusignapi


【解决方案1】:

我与 java 中的 API 进行了很多斗争,但最终在来自 github 链接:https://github.com/docusign/docusign-csharp-client/issues/75 的 C# 代码的帮助下,我成功了。

现在我在 docusign 上的模板正在使用以下代码自动填充。

只有一个进一步的信息。我进入 Docusign Web 应用程序并在那里创建了一个模板。然后我在这个模板中放置了一个文档,我在其中放置了自定义字段,如下图所示:

工作代码:

` EnvelopesApi 信封Api = new EnvelopesApi(apiClient);

EnvelopeDefinition envDef = new EnvelopeDefinition();
envDef.setEmailSubject("KYC XXX");
envDef.setTemplateId("xxxxxx-76cb-4226-adb4-3180358c8dec");

List<TemplateRole> templateRolesList = new ArrayList<TemplateRole>();
TemplateRole tRole = new TemplateRole();

Tabs tabs = new Tabs();
List<TemplateRole> rolesList = new ArrayList<TemplateRole>();
List<Text> textTabs = new ArrayList<>();
tRole.setRoleName("Signer");

Text textTab1 = new Text();
textTab1.setTabLabel("userinfo");
textTab1.setValue("RedPlanetNote2");

Text textTab3 = new Text();
textTab3.setTabLabel("business_activity");
textTab3.setValue("We sell cars");

textTabs.add(textTab1);
textTabs.add(textTab3);

tabs.setTextTabs(textTabs);
tRole.setTabs(tabs);
tRole.setName("xxx");
tRole.setEmail("xxx@gmail.com");

templateRolesList.add(tRole);

envDef.setTemplateRoles(templateRolesList);
envDef.setStatus("sent");

try {
    return envelopesApi.createEnvelope(accountId, envDef);
} catch (ApiException e) {
    e.printStackTrace();
    LOGGER.error(String.format("Exception occurred while sending signed KYC Template with prepopulation email %s with ", e));
}`

【讨论】:

    【解决方案2】:

    公司和职位字段(选项卡)以及姓名和电子邮件字段是特殊的。它们反映了接收者的属性(无论是不是签名者)。

    看到这个答案:https://support.docusign.com/en/answers/00082402

    我不知道您是否可以通过编程方式设置它们。我会请另一个团队也看看你的问题。您可以先尝试在简单的信封定义中设置字段(不涉及模板)来进行测试。如果可以,那么问题就变成了通过模板设置字段值。

    请注意,如果签名者有自己的 DocuSign 帐户,这些字段的处理方式会有所不同。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-05
      • 1970-01-01
      • 1970-01-01
      • 2018-05-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多