Custom Function : Automatically send the Quote to the related contact

Custom Function : Automatically send the Quote to the related contact

Scenario: Automatically send the Quote to the related contact. 

We create Quotes for customers regularly and when we want to send the quote to the customer, we have to send it manually.

We can automate this, using Custom Functions. Based on a criteria, you can trigger a workflow rule and the custom function associated to the rule and automatically send the quote to customer through an email.

Please note that the quote will be sent as an inline email content and not as a PDF attachment.

Please follow these steps:

  1. Log in to Zoho CRM with administrative privileges.
  2. Click Setup > Automation > Workflow > Create Rule.
  3. In the New Rule page, choose Quotes module from the drop-down list and provide other rule details.
  4. Under Execute On, choose Create or Edit and then click Next.
  5. Specify the Rule Criteria. The rule will triggered only when a record meets the criteria mentioned here.
  6. In the Actions section, click on the Add button for Call Custom Functions.
  7. In the Configure Custom Function popup, click Write your own.
  8. Specify a name for the function.
  9. Build the Deluge Script based on the code given below.



void workflowspace1.Myfunction(string quoteId)
{
resp = zoho.crm.searchRecordsByPDC("Quotes","quoteid",input.quoteId);
respstr=resp.toString();
respmap=respstr.toMap();
productmap=respmap.get("product");
jlist=productmap.toJSONList();
ContactName=respmap.get("Contact Name");
AccountName=respmap.get(("Account Name"));
Description=ifnull(respmap.get("Description"),"");
AccountID=respmap.get("ACCOUNTID");
ContactID=respmap.get("CONTACTID");
accresp = zoho.crm.searchRecordsByPDC(("Accounts"),("accountid"),AccountID);
accrespstr=accresp.toString();
accrespmap=accrespstr.toMap();
conresp = zoho.crm.searchRecordsByPDC("Contacts","contactid",ContactID);
conrespstr=conresp.toString();
conrespmap=conrespstr.toMap();
Mobile=ifnull(conrespmap.get("Mobile"),"");
Email=ifnull(conrespmap.get("Email"),"");
City=ifnull(accrespmap.get("City"),"");
Street=ifnull(accrespmap.get("Street"),"");
str="<br><br><br><table border='0' cellspacing='0' cellpadding='0' width='100%' style='background:#fff;padding:2px;'><tbody><tr><td><table border='0' cellspacing='0'cellpadding='0' width='100%' style='border-left:1px solid #dadada;border-right:4px solid#dadada;border-top:1px solid #dadada;border-bottom:4px solid #dadada;padding:10px;background-color:white;'><tbody><tr><td valign='top'><div style='font-family:Arial, Helvetica, sans-serif; font-size: 13px;'><span style='font-family: Verdana, arial, Helvetica,sans-serif; font-size: 12px;'>Hello there!&nbsp;</span><div style='font-family: Verdana, arial,Helvetica, sans-serif; font-size: 12px;'><br></div>";
str=((str + "<div style='font-family: Verdana, arial,Helvetica, sans-serif; font-size: 12px;'>Customer Name: ") + ContactName) + "&nbsp;</div><div style='font-family: Verdana, arial, Helvetica, sans-serif; font-size:12px;'><br></div>";
str=((str + "<div style='font-family: Verdana, arial, Helvetica, sans-serif; font-size:12px;'>Company Name: ") + AccountName) + "&nbsp;</div><div style='font-family: Verdana, arial,Helvetica, sans-serif; font-size: 12px;'><br></div>";
str=((str + "<div style='font-family: Verdana, arial,Helvetica, sans-serif; font-size: 12px;'>Mobile Number: ") + Mobile) + "&nbsp;</div><divstyle='font-family: Verdana, arial, Helvetica, sans-serif; font-size: 12px;'><br></div>";
str=((str + " <div style='font-family: Verdana, arial, Helvetica, sans-serif; font-size: 12px;'>Email Address:") + Email) + "&nbsp;</div><div style='font-family: Verdana, arial, Helvetica, sans-serif;font-size: 12px;'><br></div>";
str=((str + "<div style='font-family: Verdana, arial, Helvetica, sans-serif;font-size: 12px;'>City:&nbsp;") + City) + "</div><div style='font-family: Verdana, arial, Helvetica, sans-serif; font-size: 12px;'><br></div>";
str=((str + "<div style='font-family: Verdana, arial,Helvetica, sans-serif; font-size: 12px;'>Address:&nbsp;") + Street) + "</div><div style='font-family: Verdana, arial, Helvetica, sans-serif; font-size: 12px;'><br></div>";
str=((str + "<div style='font-family: Verdana, arial,Helvetica, sans-serif; font-size: 12px;'>Requirements :&nbsp;") + Description) + "</div><div style='font-family: Verdana, arial, Helvetica, sans-serif; font-size: 12px;'><br></div>";
str=str + " <div style='font-family: Verdana, arial, Helvetica, sans-serif; font-size: 12px;'>Kindly allocate the partner for the above case and also update us on the further progress of the above lead.&nbsp;</div>";
str=str + "<div style='font-family: Verdana, arial, Helvetica, sans-serif; font-size:12px;'>Regards, CNX Team</div><div style='font-family: Verdana, arial, Helvetica, sans-serif; font-size: 12px;'><br></div>";
str=str + "<table border='0' cellspacing='0'cellpadding='0' width='100%' style='font-family: Arial, Helvetica,sans-serif;font-size:11px;color:#000;'><thead><tr><td style='font-weight:bold;background-color:#eaeaea;border-top:2px solid gray;'>S.No.</td><td style='font-weight:bold;background-color:#eaeaea;border-top:2px solid gray;'>Product Details</td><td style='font-weight:bold;background-color:#eaeaea;border-top:2px solid gray;'>Qty</td><td align='right' style='font-weight:bold;background-color:#eaeaea;border-top:2px solid gray;'>List Price</td>  <td align='right' style='font-weight:bold;background-color:#eaeaea;border-top:2px solid gray;'>Total</td>  </tr> </thead>";
for each index j in jlist
{
mapvar=jlist.get(j);
finalMap=mapvar.toMap();
pdt=ifnull(finalMap.get("Product Name"),"");
qty=ifnull(finalMap.get("Quantity"),"");
listPrice=ifnull(finalMap.get("List Price"),"");
UnitPrice=ifnull(finalMap.get("Unit Price"),"");
TotalDis=ifnull(finalMap.get(("Total After Discount")),"");
qtyInStock=ifnull(finalMap.get("Quantity in Stock"),"");
Tax=ifnull(finalMap.get("Tax"),"");
netTotal=ifnull(finalMap.get("Net Total"),"");
discount=ifnull(finalMap.get(("Discount")),"");
Total=ifnull(finalMap.get("Total"),"");
str=str + "<tbody><tr><td style='border-bottom:2px dotted #dadada' valign='top'><b>" + (j  +  1) + "<br></b></td>";
str=str + "<td style='border-bottom:2px dotted #dadada'><b>" + pdt + "</b><br></td>";
str=str + "<td style='border-bottom:2px dotted #dadada' valign='top'>" + qty + "</td>";
str=str + "<td style='border-bottom:2px dotted #dadada' align='right' valign='top'>" + listPrice + "</td>";
str=str + "<td style='border-bottom:2px dotted #dadada' align='right' valign='top'>" + Total + "</td>";
str=str + "</tr></tbody>";
}
subtotal=ifnull(respmap.get("Sub Total"),"");
totaltax=ifnull(respmap.get("Tax"),"");
adjustment=ifnull(respmap.get("Adjustment"),"");
Grandtotal=ifnull(respmap.get("Grand Total"),"");
str=str + "<tbody><tr><td colspan='4' align='right'>Sub Total</td>";
str=str + "<td align='right'><b>" + subtotal + "</b></td></tr>";
str=str + "<tr><td colspan='4' align='right'>Tax</td>";
str=str + " <td align='right'>" + totaltax + "</td></tr>";
str=str + "<tr><td colspan='4' align='right'>Adjustment</td>";
str=str + "<td align='right'> " + adjustment + "</td></tr>";
str=str + "<tr><td colspan='4' style='border-bottom:2px solid #ccc' align='right'><b>Grand Total</b></td>";
str=str + "<td style='border-bottom:2px solid #ccc;border-top:2px solid #dadada;' align='right'><b>INR " + Grandtotal + "</b></td></tr></tbody></table><br><br></td></tr></tbody></table></td></tr></tbody></table>";
sendmail
[
from:zoho.adminuserid
to:Email
subject:"Quote Details"
message:str
content type:HTML
]
}

Note: This custom function is for the Quote module and you can modify it to send the automated email from the Sales Order and Invoices also. Also, we have used on the default Quote template model. If you want to change the quote layout, then you need to customize the custom function as per your requirement.

Please refer to the following link to know more about this feature:
    • Sticky Posts

    • Zoho CRM Functions 53: Automatically name your Deals during lead conversion.

      Welcome back everyone! Last week's function was about automatically updating the recent Event date in the Accounts module. This week, it's going to be about automatically giving a custom Deal name whenever a lead is converted. Business scenario Deals are the most important records in CRM. After successful prospecting, the sales cycle is followed by deal creation, follow-up, and its subsequent closure. Being a critical function of your sales cycle, it's good to follow certain best practices. One such
    • User Tips: Auto-Create Opportunity/Deal upon Quote Save (PART 1)

      Problem: We use quotes which convert to sales orders but Users / Sales Reps do not create opportunities / deals and go straight to creating a quote. This leads to poor reporting. Implementing this solution improves reporting and makes it easier for users.
    • Custom Function : Automatically send the Quote to the related contact

      Scenario: Automatically send the Quote to the related contact.  We create Quotes for customers regularly and when we want to send the quote to the customer, we have to send it manually. We can automate this, using Custom Functions. Based on a criteria, you can trigger a workflow rule and the custom function associated to the rule and automatically send the quote to customer through an email. Please note that the quote will be sent as an inline email content and not as a PDF attachment. Please follow
    • Function #50: Schedule Calls to records

      Welcome back everyone! Last week's function was about changing ownership of multiple records concurrently. This week, it's going to be about scheduling calls for records in various modules. Business scenario Calls are an integral part of most sales routines.. Sales, Management, Support, all the branches of the business structure would work in cohesion only through calls. You could say they are akin to engine oil, which is required by the engine to make all of it's components function perfectly. CRM
    • Function #37: Create a Purchase Order from a Quote

      Welcome back everyone! Last week, we learnt how to calculate the total number of activities for a lead and further take note of the activity count for particular dates. For instance, from the period of Demo to Negotiation. This week, let's look at a function that lets you create a Purchase Order instantly from a Quote. Business scenario: In any form of business, one of the most important things to do is to document the transactions. Naturally, negotiation, signing an agreement, placing an order,

    Nederlandse Hulpbronnen


      • Recent Topics

      • Showing ALL missing data

        Hi, When I create a chart, I noticed that even when enabling the "show missing values" option, if, let's say, the current time period will not show as "0" on the chart if there's no data (rows) in the table. For example, I have this data: Week 1: 0 rows
      • New Action Requests

        Hi, Is there any chances to get the new actions requested at all? I have made a few requests but never heard back from Zoho about them. I assume that developing them take time but is there any support that can provide some update? Thanks
      • Global Sets for Multi-Select pick lists

        When is this feature coming to Zoho CRM? It would be very useful now we have got used to having it for the normal pick lists.
      • Using tickets to train Zia

        Hi Team, I would like to know if there is any way that Zia can also learn from previous tickets in addition to the articles from the knowledge base. Since we have most of our knowledge curerently in the tickets and that this is hard to combine into a
      • Validation Rules Trigger on Untouched Fields

        In Zoho Desk, validation rules trigger for ALL fields during an update—even fields that weren't modified in the current edit. This behavior is fundamentally different from Zoho CRM and other Zoho products, where validation rules only apply to fields actually
      • Same users on different accounts

        I have an issue I need help with. Whilst trialing ZOHO CRM I created the following: Account1 using myname@myorganisation.com.au and 2 personal emails Account2 using a personal email and 2 users sales1@myorganisation.com.au and sales2@myorganisation.com.au
      • Kanban Deals not showing everything

        I have a deals (I call it Opportunities) module in CRM that shows various components of the opp. I'm trying to have a checkbox show up for the end user to be able to toggle it if they want an email to be sent when the change stages (in this example, it's
      • Custom Function : Copy multilookup field to text field

        Hi, I'm a newbie on function programming, I try to copy text from a multi lookup field named "societe" to a text field named "societe2". I've used this code. In deluge script it seems to work, but when I trigger this function it doesn't work (Societe2
      • Zoho CRM's V8 APIs are here!

        Hello everyone!!! We hope you are all doing well. Announcing Zoho CRM's V8 APIs! Packed with powerful new features to supercharge your developer experience. Let us take a look at what's new in V8 APIs: Get Related Records Count of a Record API: Ever wondered
      • How to automatically go to the bottom of a Zoho spreadsheet when opening the file

        Is there a way to open a Zoho spreadsheet and have it automatically go to the either the bottom row that contains any sort of text or formula?   It would work fine if it simply went to the "lowest" row for Column A that contains information.  I do see you can use the URL to go to a specific cell (and probably a named cell as well) but I haven't found a way to do what I'm asking.  The spreadsheets are fairly dynamic and information is added to them frequently.   Another thing that would work would
      • How to overcome Zoho Deluge's time limit?

        I have built a function according to the following scheme: pages = {1,2,3,4,5,6,7,8,9,10}; for each page in pages { entriesPerPage = zoho.crm.getRecords("Accounts",page,200); for each entry in entriesPerPage { … } } Unfortunately, we have too many entries
      • What are the knowledge database limit for AnswerBot and which app its integrate?

        1) Can AnswerBot be integrated in Trainer Central? 2) Can AnswerBot learn from external websites and excel spreadsheets? 3) Is there a limit size or number of documents for the knowledge based content to train AnswerBot? Thanks
      • Have you checked your Email headers for DKIM Failure?

        Have you taken a look at your email headers for DKIM failures even with DKIM set up properly? I've had DKIM successfully set up for many months. My account currently shows Email Verified and Authenticated. Big green check marks. Email Relay is also showing
      • Add more than 7 sender addresses in campaigns

        I need to add at least 15 sender email addresses but am currently limited to 7. Please can you increase. Thank you
      • How to avoid outgoing emails from Zoho CRM from being treated as SPAM/Junk when arriving in an Outlook Inbox?

        I just upgraded to Zoho CRM paid version so I could use the Mass EMail feature using a simple email template I prepared.   When testing this feature out, I sent emails to my Yahoo, GMail and to an Outlook EMail Inboxes.   Yahoo & GMail received the messages fine.    I have attached a print screen from my Outlook "Junk Folder" that shows the error message and note that at the bottom of the screen, it is obvioius that ZohoCRM's mail server is noted in the email's header/footer.  BELOW is the last few
      • Automate pushing Zoho CRM backups into Zoho WorkDrive

        Through our Zoho One subscription we have both Zoho CRM and Zoho WorkDrive. We have regular backups setup in Zoho CRM. Once the backup is created, we are notified. Since we want to keep these backups for more than 7 days, we manually download them. They
      • Managing two books in Zoho Books

        is it possible to effectively manage two separate books within Zoho Books? My organization is considering handling accounting for two distinct subsidiaries, and we would like to understand the best way to achieve this within the Zoho Books.
      • Popup or Highlight on the Form based on a comparison

        I have a field for Engine Odometer, and a field for next oil change in KM. Is it possible to generate a popup, or highlight the form, if the Engine Odometer number is larger than the next oil change in KM number?
      • Remove the dot menu and + sign on sub form

        If I don't want the user to be able to add more entries on a subform, am I able to remove the dot menu and the + sign?
      • Allow Zoho form to send to one of our ogranizations groups

        All emails from the form submission are being held for moderation. I have permissions set to organization members, and I think I have the forms setup in our DMARC
      • Disable fields in multiple subform rows

        Hello everybody! I have an odd one here. I have a subform that collects hours of operation. It contains these fields: Days, Type, Open, and Closed. On load of the form I add 7 rows with Mon - Sun in the Days field. I then disable that field and the add/delete
      • Change Last Name to not required in Leads

        I would like to upload 500 target companies as leads but I don't yet have contact people for them. Can you enable the option for me to turn this requirement off to need a Second Name? Moderation update (10-Jun-23): As we explore potential solutions for
      • to close auto payment system for renew my subscription. and get refund my deduct money.

        please consider and refund my money.
      • Unified customer portal login

        As I'm a Zoho One subscriber I can provide my customers with portal access to many of the Zoho apps. However, the customer must have a separate login for each app, which may be difficult for them to manage and frustrating as all they understand is that
      • Writing Checks to Employees for Reimbursable Expenses

        I couldn't find a way to write a check through books or expense to an employee for reimbursable expenses. The expense created an entry in the system with a debit (expense) credit (liability). I entered a bill and used the liability account so it would
      • Best way to automate quotes in CRM

        I am trying to take specific information from prospects/clients through Zoho Forms (contact info, square footage, surface area, etc.) and auto generate quotes based on the information submitted.  Ideally, the quote would be sent immediately after the form is submitted. I know Zoho has a few different ways to achieve this and wanted to know if there was a 'best practice' for automating the quotation function within CRM. Or if there was another app that can perform this functionality better (Zoho Commerce,
      • Sync Creator form submissions to WorkDrive folder

        I've made 10 Creator applications, and need to sync my each application's submissions into a WorkDrive folder. I need the form submissions to be PDF file type and sync to a specific folder for documentation purposes. I have tried to use a workflow, but
      • ZohoOne suite

        Hi, i am trying to set service for managed service offerings, I was wondering if there was a way to manage that? I would be the service manager and have a company I would be managing as well. any help would be much appreciated. I have seen that different
      • Share passwords/secrets and folders/chambers with external users

        Currently you allow sharing passwords with internal users, internal user groups, and third parties. The third party feature gives temporary access of 30 minutes and it does not have any sign up. What we really need is to properly share secrets/passwords (and ideally folders/chambers) with Zoho Vault users that are not part of our organisation - even if they are on the free plan. If they accept the share, the password would be stored in their Zoho Vault as long as I maintain the share. If I revoke
      • View Kanban tasks in "Status" layout for all projects

        Hi I'm testing Zoho Projects Express to see if it is suitable for my business. So far it looks great and seems to do everything we want (except critical path on the Gantt charts), but one thing I can't seem to figure out is this: If I go into a project, and choose "Kanban", I can select the "Status" layout which is great. I can see the status of all of the tasks in that project, and who is working on what. However, if I go to: Home > My Tasks > Kanban, then the "Status" layout isn't an option - only
      • Subform dynamic fields on Edit, Load of Main form.

        Main Form: Time_Entry Sub Form (separate form): Time_Entries Time_Entries.Time_Entry_No is lookup to - Time_Entry.Time_Sheet_ID (auto number). I would like to disable some of the subform fields upon load (when edited) of the Time_Entry main form. What
      • Save Draft in email bigin for desktop and mobile

        Hi any news to when we going to have the save draft for email in bigin desktop and mobile?
      • Zoho Desk and Zoho Inventory

        I am hoping I am not the only one with this need but has anyone else notice the lack of integration between Zoho Desk and Zoho Inventory and eventual funneling into an Invoice in Zoho Books?  As an IT service provider we very often will sell parts (items) along with services for installing said item(s).  I have discovered that although you can integrate your Inventory Items into Desk as a "Product", it serves no real functionality.  In fact, I found the concept confusing compared to how many Service
      • Including Field in email body based on answer

        I am making a form as a checklist of our mechanics. I have it setup with choice matrix. The choices are "Bad" and "Good". I would like to have only the "Bad" show up in the email body. I am not against changing how it is setup, thank you.
      • Remove attachment from ticket

        Hello, When we receive e-mails from our customers, lots of those e-mails contain attachments with sensitive information, which we need to delete from the ticket after using it. It is forbidden for our company to store these attachments, due to security reasons.  Is there a possibility to delete an attachment from a ticket in any way? It is necessary for us that this possibility is available. Thanks in advance, Yorick
      • Fetch function not working for CRM Contacts

        I've created a flow that checks if a contact exists in CRM (based on form input), and if it does, then it updates one of the fields for the contact. In my test, the fetch function correctly identifies that a contact exists (based on email address), but
      • Zoho Bigin | Adding users to a deal in bigin

        Hi, One of our ongoing POCs required adding users to a deal in Bigin. I found that we cannot add individuals using custom fields when we have an Express license. Is there any way to do it?
      • How to create Comparison across Period chart in a dashboard?

        Hi all How can I create this chart in a custom dashboard? The issue for me is that this chart is very small. The CRM module (unlike Projects module) has no ability to expand a chart. I want to make it larger, but also want to include it in a custom Forecast
      • Add Subform Field based on Record Field

        Hi All, I am struggling with finding a solution that can populate a subform field based on an existing field on the record. Use case is I have added Current Exchange Rate on a quote as a custom field, I then have a subform with Quoted items that include
      • CREATE REPORT USING TWO FORMS

        ONE FORM CONTAINS LIST OF ALL CLIENTS WHOSE RETURN IS FILED AND OTHER FORM CONTAINS LIST OF RETURNS FILED YEARWISE. NOW I REQUIRED A REPORT OF ALL CLIENTS WHOSE RETURN ARE PENDING FOR A PARTICULAR YEAR
      • Next Page