Many businesses purchase goods and services from multiple suppliers and track this information in the vendors module of Zoho CRM. Some of these businesses may need to create vendor agreements, onboarding documents, and compliance forms as part of their procurement process. This involves creating email templates for a mail merge that automatically fills in context-specific details for each vendor record.
However, if you take a cursory look at your CRM, you'll notice that mail-merge templates are not available for the vendors module. Additionally, the vendors module does not support e-signatures via the Zoho Sign extension. As a result, many businesses find the vendor module impractical and unusable. However, this doesn't need to be the case anymore! Using the flexibility of our low-code tools, including custom functions and buttons, you can create an effective workaround. Read on to learn how to build a fully automated vendor document workflow—from creation to signature—inside your CRM.
Permissions and availability
- Users with the Modules Customization permission can add custom modules, fields, and buttons.
- Users with the Manage Templates permission can create and update email templates.
- Users with the Manage Automation permission can create and update workflow rules.
- Users with the Manage Extensibility permission can create connections and write custom functions.
- Users with the Manage Sandbox permission can manage the sandbox.
Requirements
- Install the Zoho Sign extension, version 22 or higher, from the marketplace. Learn more
- Add a custom module with a Lookup field to the Vendors module. This allows you to use fields from the Vendors module to create a mail merge template in the custom module. Learn more
- Create a workflow rule in the Vendors module that automatically generates a related record in the custom module whenever you add a new vendor record. Learn more
- Create a mail merge template for the custom module that generates the vendor document. Learn more
- Add a button on the custom module details page that, when clicked, opens the workflow to send the document for signature. Learn more
- Create a Zoho CRM connection with the required scopes as detailed in the "Create Connection" section below. Learn more
- Add a custom Lookup field to the Zoho Sign Documents module to connect signed files with the vendor record. Learn more
- Create a workflow rule in the Zoho Sign Recipients module that triggers when a document is marked as signed or completed.
- Write a custom Deluge function that automatically attaches signed documents to their corresponding vendor records and link it to the workflow rule. Learn more
- Test the solution in a sandbox before deploying it in your production environment. Learn more
Add a custom module and field
First, create a custom module and add a lookup field to the Vendors module in it. This allows you to use fields from the Vendors module to create a mail merge template in the custom module.
- Navigate to Setup > Customization > Modules and Fields.
- Click Create New Module and do the following:
- Drag and drop the Lookup field from the New Fields tray into the layout.
- Name the lookup field (e.g., "Vendor") and the Related List Title (e.g., "eSign Documents") as required.
- Remove unnecessary fields, except key fields such as name, email, and owner.
- Select Done, and then click Save and Close.
- Enter a name for the module - both the singular and plural forms, then click Done. For example, eSign Document and eSign Documents, respectively.
- Click Save.
Create a workflow rule
Next, create a workflow rule in the Vendors module to automatically generate a related record in the custom module whenever you add a new vendor record.
- Navigate to Setup > Workflow Rules > + Create Rule.
- Select Vendors from the module dropdown list.
- Provide a name for the rule. For example: "Create an eSign document for vendors".
- Add a description (optional), then click Next.
- In the Execute this workflow rule based on section, choose Record Action, select Create from the dropdown, and click Next.
- In the Which vendors would you like to apply the rule to? section, select All Vendors, then click Done.
- Under Instant Actions, select Create Record and do the following:
- Select eSign Documents from the module dropdown list.
- Enter a name for the record. Ideally, a placeholder such as #VendorName
- Select Logged in User as the record owner.
- Click Save.
- Click Save on the workflow rule page.
Create a mail merge template
Next, create a mail merge template for the custom module that generates the vendor document. This document will be sent to Zoho Sign for e-signature using a custom button.
- Navigate to Setup > Customization > Templates > Mail Merge > New Template.
You can also choose to import templates from MS Word or PDF. - On the Create New Template page, do the following:
- Select eSign Documents from the module dropdown list.
Note that the Vendors module will not be available. - Provide a name for the template. For example: "eSign Document".
- Select the folder where the template will be stored.
- Select eSign Documents from the module dropdown list.
- Click Create.
A Zoho Writer document will open on a new tab. - Create a template that includes the necessary merge fields.
Note: Make sure you add a signer field and configure the signers for the document. - Click Done.
Create a custom button
Next, add a custom button to the eSign Documents details page that, when clicked, opens the workflow to send the document for signature.
- Navigate to Setup > Customization > Modules and Fields > eSign Documents > Buttons > Create New Button.
- Provide a name for the button (e.g., "Send with Zoho Sign").
- Add a description (optional).
- Set the action to be performed as Invoke a URL.
- Select the button's page and position as "In Record" and "Details," respectively.
- Choose the layouts where you want the button to be placed.
- Click Choose to configure a function and select Write your own.
- Copy and paste the link below into the URL field.
- Select the profiles that can view this custom button.
- Click Save.
https://sign.zoho.com/api/v1/integrations/zohocrm/homepage?module=eSign_Documents&record_id=${eSign Documents.eSign Document Id}&crmzgid=${Organization.Organization Id}&record_name=${eSign Documents.eSign Document Name}
Notes
- Change the URL endpoint to match the data center of your account. E.g., https://sign.zoho.in/... for India.
- Make sure to use the accurate API name for the corresponding module (e.g., "eSign_Documents") in the code snippet. Learn more
Create a connection
Next, create a new connection in your Zoho CRM account. This connection enables CRM to retrieve, download, and attach Zoho Sign documents to vendor records.
- Go to Setup > Developer Hub > Connections.
- Click Create Connection.
- Select Zoho CRM under Default Services.
- Specify a Connection Name.
You must enter this name in the code snippet below. - Select the following Scopes to request access:
- ZohoCRM.modules.ALL
- ZohoCRM.modules.attachments.all
- Click Create and Connect.
- Click Connect, then click Accept to confirm authorization of access for the scope requested by the client.
Add a custom field
Next, add a custom lookup field to the Zoho Sign Documents module. This field will facilitate mapping the signed files back to the vendor record.
- Navigate to Setup > Customization > Modules and Fields.
- Click the Zoho Sign Documents module to open the layout editor and do the following:
- Drag and drop the Lookup field from the New Fields tray to the desired section of the layout.
- Name the lookup field (e.g. "Vendor").
- Select Vendors as the lookup module.
- Specify a title for the related list.
- Click Done.
- Click Save and Close.
Create a workflow rule
The final step is to write and connect a custom function with a workflow rule in the Zoho Sign Recipients module. This workflow automatically attaches signed documents to their corresponding vendor records in your CRM.
- Navigate to Setup > Workflow Rules > +Create Rule.
- Select the Module as Zoho Sign Recipients from the drop-down list.
- Provide a name for the rule. For example: "Attach signed documents to vendors".
- Add a description, if required, then click Next.
- In the Execute this workflow rule based on section, do the following:
- Choose Record Action, then select Edit from the drop-down.
- Choose Specific field(s) gets modified from the dropdown, then enter the condition "When <Recipient Status> is modified to <the value> <Completed>".
- Click Next.
- In the Which zoho sign recipients would you like to apply the rule to? section, select All Zoho Sign Recipients, then click Next.
- Under Instant Actions, select Function and Write your own.
- Provide a Name for the function, as well as a description, if necessary.
- On the Deluge Script Editor, do the following:
- Copy and paste the code given below.
- Click Edit Arguments.
- Choose Zoho Sign Recipients - Zoho Sign Recipient Id, name it eventId, and click Save.
- Click Save & Execute script.
- Click Save on the workflow rule page.
The code
getSignedDocumentEvent = invokeurl
[
url :"https://www.zohoapis.com/crm/v8/zohosign__ZohoSign_Recipients/" + eventId + ""
type :GET
connection:"connectionname"
];
info "getSignedDocumentEvent >> " + getSignedDocumentEvent;
data = getSignedDocumentEvent.getJson("data");
recepientEmail = data.getJson("Email");
info "recepientEmail >> " + recepientEmail;
signDocumentId = data.getJson("zohosign__ZohoSign_Document").getJson("id");
info "signDocumentId >> " + signDocumentId;
getSignedDocument = invokeurl
[
url :"https://www.zohoapis.com/crm/v8/zohosign__ZohoSign_Documents/" + signDocumentId + ""
type :GET
connection:"connectionname"
];
info "getSignedDocument >> " + getSignedDocument;
moduleName = getSignedDocument.getJson("data").getJson("zohosign__Module_Name");
info "moduleName >> " + moduleName;
if(moduleName == "Vendors")
{
seaRecd = zoho.crm.searchRecords("Vendors","(Email:equals:" + recepientEmail + ")");
if(seaRecd.size() > 0)
{
recdId = seaRecd.get(0).getJson("id");
info "recdId >> "+recdId;
getSignedDocumentAtt = invokeurl
[
url :"https://www.zohoapis.com/crm/v8/zohosign__ZohoSign_Documents/" + signDocumentId + "/Attachments?fields=id,File_Name"
type :GET
connection:"connectionname"
];
info "getSignedDocumentAtt >> " + getSignedDocumentAtt;
if(getSignedDocumentAtt.getJson("data").size() > 0)
{
for each document in getSignedDocumentAtt.getJson("data")
{
if(document.getJson("File_Name").contains("signed") == True)
{
attId = document.getJson("id");
info "attId >> " + attId;
downloadAttachment = invokeurl
[
url :"https://www.zohoapis.com/crm/v8/zohosign__ZohoSign_Documents/" + signDocumentId + "/Attachments/" + attId + ""
type :GET
connection:"connectionname"
];
info "downloadAttachment >> " + downloadAttachment;
attFile = zoho.crm.attachFile("Vendors",recdId,downloadAttachment);
info "attFile >> " + attFile;
}
break;
}
}
}
}Notes
- Make sure to use the accurate API names for their corresponding fields (e.g., "Zoho Sign Module Name") in the code snippet. Learn more
- Replace "connectionname" with the name of the connection you specified when creating it (see the "Create a connection" section above).
- Change the URL endpoint to match the data center of your account. E.g., https://www.zohoapis.in/... for India.
Tip
- Configure and test the function in a sandbox to ensure that further development doesn't disrupt your production environment.
Test the solution
- Navigate to the Vendors module.
- Create a new vendor record and click Save.
This will trigger the workflow rule that automatically creates a related record in the
eSign Documents module. - Open the newly created related record under the eSign Documents related list on the vendor record.
- On the eSign Document Details page, click the Send with Zoho Sign custom button.
This will open the Zoho Sign workflow and generate the document using the mail merge template. - Review the document, add recipients if required, and click Send to initiate the signature request.
- Open the signing link received in the vendor’s email and complete the document signing process.
- Once the document status is marked as Completed, the Zoho Sign Recipients workflow rule will be triggered.
- Return to the Vendors module and open the same vendor record.
- Check the Attachments related list to verify whether the signed document has been automatically downloaded and attached to the vendor record.
Did you find this useful? Try it out and let us know how it works. Share this with your team if they'd benefit from it! If you have questions, please don't hesitate to contact us.
More info
- ModuleVendors
- Trigger PointCustom Button
- EditionEnterprise and above
- ComplexityHigh
- Implementation Time60 minutes

Looking for a custom solution?
Contact us, we will help enhance your productivity at lightning speed.
SUBMIT REQUEST