Lasernet is able to generate a PDF file that can be sent to a customer's Docusign portal for authorisation. The basic principle is that you define in Dynamics who should authorise the document which is to be sent as a Jobinfo to Lasernet which in turn sends the email address and the PDF file to the Docusign portal for processing.
The following steps can be taken to ensure a PDF file is sent to a customer's Docusign portal for authorisation:
1. A Dynamics developer is needed to create a form where we can setup default employees on a vendor or customer or wherever you need it.
Here is a sample where we have added Vendor Mapping to the Vendor. On the vendor, you create a "default" setup of employees which can subsequently be retrieved from the Purchase order / "Employee mapping".
2. On the Purchase order form, add another form called Employee Mapping. Here you can view the default settings that you type in on the vendor form and override them if needed. We need an email address for all that need to sign the document.
3. Now that you have a form where you can see the email addresses, add those into the XML file that is sent to Lasernet. Please do this via the Query wizard or Structure in Lasernet.
There are some changes to the Lasernet build that are needed.
1. Add a new Output module by adding an HTTP module:
2. Fill in the information on the Setup / Connection tab.
3. Select the Headers tab and add the following using the Add button:
- Content-Type text/xml; charset=utf-8
- SOAPAction http://www.docusign.net/API/3.0/CreateAndSendEnvelope
- X-DocuSign-Authentication <DocuSignCredentials><Username>#DSUserName#</Username><Password>#DSPassword#</Password><IntegratorKey>#DSIntegratorKey#</IntegratorKey></DocuSignCredentials>
The username and password can be hardcoded in Pre JobInfos if you don't get that from the datastream.
Now we have a module with a connection to Docusign. The next step is the add a new Base 64 Encode modifier if you do not already have one.
4. Go to Modifiers and add a Base64 modifier. Name it Base64 Encode and make sure that you have selected Base64 Encoder in Direction.
Change you Lasernet Form
1. Navigate to your form on the report on which you need to sign with Docusign. In this example, we are using the Purchase order form.
2. Add a new sheet after the PDF sheet with XML as input and output and ensure you add Sheet criteria so only this sheet is executed when needed.
3. You need to import this template. You might have to create an XML file manually and insert this text:
<?xml version='1.0'?> <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <CreateAndSendEnvelope xmlns="http://www.docusign.net/API/3.0"> <Envelope> <AccountId>76dc1c5b-6fdc-425b-b50d-be89e38dc696</AccountId> <Documents> <Document> <ID>1</ID> <Name>Our Document</Name> <PDFBytes>#PDFJobData#</PDFBytes> </Document> </Documents> <Recipients> <Recipient> <ID>1</ID> <UserName>Torben Pedersen</UserName> <Email>firstname.lastname@example.org</Email> <Type>Signer</Type> <AccessCode xsi:nil="true"/> </Recipient> </Recipients> <Tabs> <Tab> <DocumentID>1</DocumentID> <RecipientID>1</RecipientID> <PageNumber>1</PageNumber> <XPosition>200</XPosition> <YPosition>200</YPosition> <Type>SignHere</Type> </Tab> </Tabs> <Subject>Lasernet FTW</Subject> <EmailBlurb>Lasernet is here!</EmailBlurb> </Envelope> </CreateAndSendEnvelope> </s:Body> </s:Envelope>
4. Add the information you need from the XML file. Include the email addresses of the persons that need to sign the document.
5. Switch to your PDF sheet, open up Sheet Options. select Modifiers and add these two to the Sheet End:
6. Go back into the DocuSign sheet and insert a text field into the Recipient/ID section:
7. Change the Object type to Script and then type in Line+1 for the Object value.
8. Ensure that the DocuSign sheet is going to the right destination:
9. Save the Form and ensure that you update the Lasernet server.
You should now be able to send the PDF to DocuSign and get your document signed.