Sales reps often use the Contact Name lookup field to associate a contact with a quote record. While this process automatically links the records in your CRM, it doesn't transfer more detailed contact information into the quote. For example, custom fields, additional address details, or other quote-specific information from the contact record aren't automatically populated in the quote.
The absence of this information can create gaps that lead to incomplete proposals, delayed approvals, and sales reps manually switching between the quote and contact records to fill in missing details. What if you could automatically copy specific details from the associated contact record into the quote whenever a sales rep creates a quote or updates the Contact Name lookup field? This is where a custom function can help.
To address this, create corresponding fields in the Quotes module and configure a workflow rule to trigger a custom Deluge function whenever a quote is created or edited. The function retrieves details from the associated contact record and automatically populates the relevant fields in the quote record. Read on to learn more.
Permissions and availability
- Users with the Modules Customization permission can add custom fields.
- Users with the Manage Automation permission can create and update workflow automations.
- Users with the Manage Extensibility permission can create custom functions.
- Users with the Manage Sandbox permission can manage the sandbox.
Requirements
- Add the necessary contact fields to the Quotes module. These fields will store the contact's information when the function is triggered. Learn more
- Create a workflow rule for the Quotes module that triggers whenever a sales rep creates a quote or updates the Contact Name lookup field. Learn more
- Write a custom Deluge function that retrieves details from the associated contact record and automatically populates the corresponding fields in the quote record. Learn more
- Test the workflow rule in a sandbox before deploying it to your production environment. Learn more
Add custom fields
The first step is to add the required contact fields to the Quotes module:
- Navigate to Setup > Customization > Modules and Fields, then select the Quotes module to open the layout editor.
- In the layout editor, do the following:
- Drag and drop the required field into the layout, name it (for example, "Email"), define its properties, and click Done.
- Repeat the process for each contact detail that you want to copy from the contact record.
- Once you've finished, click Save and Close.
Create a workflow rule
Next, create a workflow rule and connect it with a custom function:
- Navigate to Setup > Workflow Rules > + Create Rule.
- Select Quotes from the module dropdown list.
- Provide a name for the rule. For example: "Copy contact details to quote".
- 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 Create or Edit from the dropdown.
- Check the box for Repeat this workflow whenever a quote is edited option.
- Click Next.
- In the Which quotes would you like to apply the rule to? section, specify the condition as "<Contact Name> <is not empty>", 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.
- In the Deluge Script Editor, do the following:
- Copy and paste the code provided below.
- Click Edit Arguments.
- Enter the name as contId and select the value as Contacts - Contact Id.
- Click the + icon to add another argument.
- Enter the name as quoteId and select the value as Quotes - Quote Id, then click Save.
- Click Save & Execute Script.
- Click Save on the workflow rule page.
The code
contDetails = zoho.crm.v8.getRecordById("Contacts", input.contId.toLong());
mp=map();
mp.put("Email",ifnull(contDetails.get("Email"),""));
mp.put("Mobile",ifnull(contDetails.get("Mobile"),""));
mp.put("GST_Number",ifnull(contDetails.get("GST_Number"),""));
mp.put("Customer_Type",ifnull(contDetails.get("Customer_Type"),""));
mp.put("Credit_Status",ifnull(contDetails.get("Credit_Status"),""));
mp.put("Special_Pricing_Eligibility",ifnull(contDetails.get("Special_Pricing_Eligibility"),""));
updateResp= zoho.crm.v8.updateRecord("Quotes",input.quoteId.toLong(), mp);
info mp;
info updateResp;Notes
- Use the accurate API name of the fields (e.g., "Email") used in the code snippet. Learn more
- The code snippet contains sample fields that you can customize to suit your business requirements.
- The fields on the left side (after mp.put) are the destination fields, while those on the right are the source fields.
- The code above demonstrates how to automatically copy specific details from the associated contact record into a quote whenever sales reps create a quote or update the Contact Name lookup field in your CRM. You can adapt this code for other modules by modifying the module name, field names, and relevant parameters.
Tip
- Configure and test the solution in a sandbox to ensure that further development doesn't disrupt your production environment.
Test the solution
- Navigate to Quotes > Create Quote.
- On the Quote Details page, enter the required information, including selecting a contact in the Contact Name lookup field, then click Save.
The workflow rule will be triggered. - Refresh the quote record and verify that the following fields are populated from the associated contact record:
- Mobile
- GST Number
- Customer Type
- Credit Status
- Special Pricing Eligibility
- Edit an existing quote with an empty Contact Name field, associate a contact, and verify that the fields are populated automatically.
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
- ModuleQuotes
- Trigger PointWorkflow Rule
- EditionEnterprise and above
- ComplexityMedium
- Implementation Time30 minutes

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