Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting custom fields programatically #31

Closed
raghav-g opened this issue Oct 8, 2016 · 3 comments
Closed

Setting custom fields programatically #31

raghav-g opened this issue Oct 8, 2016 · 3 comments

Comments

@raghav-g
Copy link

raghav-g commented Oct 8, 2016

Hi,

I have set few custom fields in my template and want to send an envelope programatically filling the custom fields in my application. I tried this and it did not work. Can you please help me out here?

`

       CustomFields fields = new CustomFields();
        TextCustomField tcf = new TextCustomField();
        tcf.setName("test");
        tcf.setValue("kabalikhan");
        tcf.setShow("true");

        List<TextCustomField> tcfs = new ArrayList<>();
        tcfs.add(tcf);
        fields.setTextCustomFields(tcfs);

        // send the envelope by setting |status| to "sent". To save as a draft set to "created"
        envDef.setCustomFields(fields);
        envDef.setStatus("sent");


        // instantiate a new EnvelopesApi object
        EnvelopesApi envelopesApi = new EnvelopesApi();


        // call the createEnvelope() API
        EnvelopeSummary envelopeSummary = envelopesApi.createEnvelope(accountId, envDef);

`

@mmallis87
Copy link
Contributor

Your code looks good to me.

Here is what you should know about custom fields: they should be enabled by default in sandbox (demo) environment. However, in live (production) environments they might be turned off, depending on the plan that you've purchased.

Even if you aren't in demo, I'd suggest that you do tests in demo. For that you need to make sure to add a custom field named "test" in your account preferences: https://appdemo.docusign.com/preferences/custom-fields

Once this is done, if you still have issues, I'd suggest that you share any error messages or logs that you might have, so that we can help with troubleshooting.

It might be worth it to double-check that DocuSign logging is enabled for your test account: https://support.docusign.com/en/guides/ndse-user-guide-api-request-logging

@mmallis87
Copy link
Contributor

@raghav-g Please update the status of the issue. In case the issue persists, please include some logs or error messages that you get. That would be helpful.

@mmallis87
Copy link
Contributor

havent heard from the issue reporter for while. closing it. reopen in case there is a real bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants