rumfords

Rename Transaction Document

0 votes

Hi.  Can you tell me if it is possible to change a template document name for a new transaction, and if so how this can be done?

e.g.

            Form form = new Form("FormName");

            String templateIDStr = form.TemplateID;
            PackageId templateId = new PackageId(templateIDStr); 

            DocumentPackage template = client.GetPackage(templateId);

            string phSignerID = template.Placeholders.Where(p => p.PlaceholderName == "Signer1").First().Id;

            DocumentPackage package = PackageBuilder.NewPackageNamed(packageName)
                    .WithEmailMessage(emailMsg)
                    .WithSenderInfo(SenderInfoBuilder.NewSenderInfo(senderEmail))
                    .WithSigner(SignerBuilder.NewSignerWithEmail(member.EmailAddress)
                        .WithFirstName(member.FirstName)
                        .WithLastName(member.LastName).Replacing(new Placeholder(phSignerID))
                        .WithTitle(member.Title)
                        .WithCompany(member.Company)
                    )
                .Build();

            PackageId packageID = client.CreatePackageFromTemplate(templateId, package);


            DocumentPackage packageDoc = client.GetPackage(packageID);

            String documentName = form.TemplateDocument;
            Document document = packageDoc.GetDocument(documentName);
            document.Name = "The New Document Name";   //THIS DOESN'T WORK

 

Thanks


Reply to: Rename Transaction Document

0 votes

Hi Steve,

 

You need an extra call to make the update take effect:

eslClient.PackageService.UpdateDocumentMetadata(packageDoc, document);

Let me know if this works for you.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Rename Transaction Document

0 votes

Hi,

This works fine.  Thanks again for your help.

Steve


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off