Rename Transaction Document
Monday, April 19, 2021 at 11:25amHi. 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
Monday, April 19, 2021 at 11:55amHi 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
Reply to: Rename Transaction Document
Monday, April 19, 2021 at 12:39pmHi,
This works fine. Thanks again for your help.
Steve