docusign / docusign-esign-csharp-client

The Official Docusign C# Client Library used to interact with the eSignature REST API. Send, sign, and approve documents using this client.
https://developers.docusign.com/docs/esign-rest-api/sdks/csharp/
MIT License
129 stars 159 forks source link

Signer.CustomFields is not updated when calling update recipients method. #307

Open sameedaris opened 3 years ago

sameedaris commented 3 years ago

I am updating email of the recipient using C# docusign SDK. update Email is working fine.I am calling envelopesApi.UpdateRecipients method beside update email I want to Update custom fields of that particular signer. It is not updating custom fields with new values that I am providing value by setting singer.CustomFields Property. Please suggest what to do

ivdinkovds commented 3 years ago

@sameedaris please if you can clarify your issue. Is your issue updating recipient email or updating custom fields values? As well will be nice if you can provide code snippet

ivdinkovds commented 3 years ago

@sameedaris, If your aim is to update only the email you do not have to edit/add custom fields for this user.

var recipinetList = envelopesApi.ListRecipients(accountId, envelopeId); Signer theOne = recipinetList.Signers.Where(s=>s.Email.Contains("something")).FirstOrDefault(); theOne.Email = "new email"; Recipients recipients = new Recipients { Signers = new List<Signer> { theOne } }; EnvelopesApi.UpdateRecipientsOptions updateRecipientsOptions = new EnvelopesApi.UpdateRecipientsOptions(); updateRecipientsOptions.resendEnvelope = "true"; // in case of in-flight envelope var update = envelopesApi.UpdateRecipients(accountId,envelopeId,recipients,updateRecipientsOptions);

sameedaris commented 3 years ago

@sameedaris, If your aim is to update only the email you do not have to edit/add custom fields for this user.

var recipinetList = envelopesApi.ListRecipients(accountId, envelopeId); Signer theOne = recipinetList.Signers.Where(s=>s.Email.Contains("something")).FirstOrDefault(); theOne.Email = "new email"; Recipients recipients = new Recipients { Signers = new List<Signer> { theOne } }; EnvelopesApi.UpdateRecipientsOptions updateRecipientsOptions = new EnvelopesApi.UpdateRecipientsOptions(); updateRecipientsOptions.resendEnvelope = "true"; // in case of in-flight envelope var update = envelopesApi.UpdateRecipients(accountId,envelopeId,recipients,updateRecipientsOptions);

Hello, @ivdinkovds Sorry for late reply. I am facing issue in custom fields. I want to update custom fields for particular recipient.

ivdinkovds commented 3 years ago

@sameedaris Any custom tabs once assigned to signer are accessible just as normal tabs associated with him. To get all signer tabs you can add ListRecipientOptions with option to include tags. This should return Tabs object containing list of all tabs assosiated with him `

        EnvelopesApi.ListRecipientsOptions listRecipientsOptions = new EnvelopesApi.ListRecipientsOptions();
        listRecipientsOptions.includeTabs = "true";

        var recipinetList = envelopesApi.ListRecipients(accountId, envelopeId, listRecipientsOptions);
        var signerTabs = recipinetList.Signers.Where(s => s.Name.Equals("something")).FirstOrDefault().Tabs;

` You can change the value and update the Signer object

sameedaris commented 3 years ago

@sameedaris Any custom tabs once assigned to signer are accessible just as normal tabs associated with him. To get all signer tabs you can add ListRecipientOptions with option to include tags. This should return Tabs object containing list of all tabs assosiated with him `

        EnvelopesApi.ListRecipientsOptions listRecipientsOptions = new EnvelopesApi.ListRecipientsOptions();
        listRecipientsOptions.includeTabs = "true";

        var recipinetList = envelopesApi.ListRecipients(accountId, envelopeId, listRecipientsOptions);
        var signerTabs = recipinetList.Signers.Where(s => s.Name.Equals("something")).FirstOrDefault().Tabs;

` You can change the value and update the Signer object

I need to update CustomFields for Signer not Tabs. Here is Code for setting custom fields . please guide me how to update custom fields.

 var singer = new Signer() { RecipientId = input.OldEnvelopeRecipientID };
                        if (string.IsNullOrWhiteSpace(eEmail))
                        {
                            singer.SigningGroupId = NewgroupdID;
                            singer.Name = groupName;
                        }
                        else
                        {
                            singer.Email = NewEmail;
                            singer.Name = Name;
                        }
// this field is not updating when calling update reciepents method
                        singer.CustomFields = DigitalCustomFieldHelper.GenerateCustomFields(customFieldsModel);

                        recipeints.Signers.Add(singer);
EnvelopesApi envelopesApi = new EnvelopesApi(ApiClient.Configuration);

 var result = envelopesApi.UpdateRecipients(AccountID, envelopeId, recipients: recipients,
                  new EnvelopesApi.UpdateRecipientsOptions() { resendEnvelope = resend.ToString() });
ivdinkovds commented 3 years ago

CustomFields and Tabs/Tags are essentially the same. You can convert any filed ( text, date ) and save it as CutomField. The code above will allow you to update any custom fields assigned to the signer

sameedaris commented 3 years ago

Thanks @ivdinkovds . You mean to say if my code loads all tabs for particular signer it should have custom field values too. I will check it for sure. but the problem is that I don't want to make Get recipients method call because of DocuSign violation rules. I just want to make update call with respective ID.

sameedaris commented 3 years ago

Hi @ivdinkovds , I ran a test and custom fields are separate property in C# SDK. They are not populated inside tabs property, Please check screenshots. image image

ivdinkovds commented 3 years ago

@sameedaris Thanks for finding this out. Most of the time our customers by signer custom fields reference the document custom fields assigned to particular signer which are found under Tags. My apologies. In this case you are correct. We tested it and confirmed, signer custom fields update functionality does not appear to work. There is a bug case created now

sameedaris commented 3 years ago

Thanks a lot.

sameedaris commented 3 years ago

@ivdinkovds Could you please give us rough Idea when this should be fixed ? Our product delivery is dependent on this.

ivdinkovds commented 3 years ago

@sameedaris Update: It has high priority but It is really up to the engineering team to decide on delivery and deployment.

sameedaris commented 3 years ago

OK thanks .

LarryKlugerDS commented 3 years ago

Hi @sameedaris , unfortunately, from my experience, it will probably take a long time for this type of issue to be fixed. In the meantime, I suggest that you store/update your metadata in a different spot within the Envelope object. Perhaps as an envelope custom field.

sameedaris commented 3 years ago

Thanks @LarryKlugerDS .

sameedaris commented 3 years ago

@LarryKlugerDS Boss any update on this? Thanks in advance.

sameedaris commented 3 years ago

Hello, Guys please let us if there is any update on this? If we could some released date for this issue We would appreciate it. Thanks Again.