Transfer notes from a deal to its related quotes

When creating a quote, automatically transfer the notes from its deal record to the quote so that everyone involved can access the same information.

It is common to take notes of key points when working on a deal with a potential customer. Such notes provide transparency to the team regarding what you have discussed with clients or what actions have been taken on file. However, what if you would like to transfer those notes into a quote created for the deal, so that everyone involved can access the same information? This is where a custom function can come in handy.

You can create a custom function that automatically transfers notes from a deal record to its related quotes. It is necessary to trigger this function when creating a quote record using a workflow rule to ensure the availability of all relevant notes in the quote.

Permissions and availability

  • Users with the Manage Automation permission can create and update workflow rules.
  • Users with the Manage Extensibility permission can write custom functions.
  • Users with the Manage Sandbox permission can manage the sandbox.

Requirements

  • Create a workflow rule for the Quotes module that will trigger a custom function whenever a quote is created. Learn more
  • Write a custom Deluge function that transfers notes from a deal to its related quote and link it up with the workflow rule. Learn more
  • Test the workflow rule in a sandbox before deploying it in your production environment. Learn more

Create a workflow rule

  1. Navigate to Setup > Workflow Rules > +Create Rule.
  2. Select Quotes from the module dropdown list.
  3. Provide a name for the rule. For example: "Transfer notes from deal".
  4. Add a description, if required, then click Next.
  5. In the Execute this workflow rule based on section, choose Record Action, select Create from the drop-down, then click Next.
  6. In the Which quotes would you like to apply the rule to? section, select All Quotes and click Next.
  7. Under Instant Actions, select Function and Write your own.
  8. Provide a Name and description, if required, for the function.
  9. On the Deluge Script Editor, do the following:
    1. Copy and paste the code given below.
    2. Click Edit Arguments.
    3. Enter the name as dealId, select the value as Deals - Deal Id, then click Save.
    4. Click Save & Execute Script.
  10. Click Save on the workflow rule page.
Create Workflow Rule

The code

Code Copied
relatedquotes = zoho.crm.getRelatedRecords("Quotes","Deals",dealId);
relatedNotes = zoho.crm.getRelatedRecords("Notes","Deals",dealId);
for each  quote in relatedquotes
{
	for each  note in relatedNotes
	{
		mp = Map();
		mp.put("Parent_Id",quote.get("id"));
		mp.put("Note_Content",ifnull(note.get("Note_Content"),""));
		mp.put("Note_Title",ifnull(note.get("Note_Title"),""));
		mp.put("$se_module","Quotes");
		create = zoho.crm.createRecord("Notes",mp);
		info mp;
		info create;
	}
}

Notes

  • Make sure to use the accurate API names for their corresponding fields in the code snippet. Learn more
  • The above script is an example of transferring notes from a deal to its related quote upon its creation. You can customize the field name and parameters to transfer other deal details to the quote.

Tip

  • Configure and test the function in a sandbox to ensure that further development doesn't disrupt your production environment.

Test the solution

  1. Go to the Deals module and click on the desired deal.
  2. On the Deal Details page, click the + button next to Quotes in the Related List.
  3. Enter the necessary information on the quote details page, then click Save.
    The workflow rule will be triggered.
  4. Check whether all the notes from the deal have been transferred to the quote 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

  • ModuleQuotes
  • Trigger PointWorkflow Rule
  • EditionEnterprise and above
  • ComplexityLow
  • Implementation Time15 minutes

Features used in the solution

Workflow RuleDeluge ScriptSandbox
Story Image

Looking for a custom solution?

Contact us, we will help enhance your productivity at lightning speed.

SUBMIT REQUEST

Developers: Share your solution with our community!