For Zoho services only


I'm currently part of a wider delivery team at Ascent Business Solutions, recognised as a leading Zoho Premium Solutions Partner in the United Kingdom.

Ascent Business Solutions support organisations with everything from targeted technical fixes through to full Zoho CRM implementations and long-term platform adoption. Working as a team rather than a one-person consultancy allows projects to move forward consistently, with access to the right skills at each stage.

The team I manage specialises in API integrations between Zoho and third-party finance and commerce platforms such as Xero, Shopify, WooCommerce, and eBay. Much of our work involves solving integration challenges that fall outside standard documentation, supporting new ideas, new sectors, and evolving business models.

Success is measured through practical outcomes and return on investment, ranging from scaling small operations into high-turnover businesses to delivering rapid gains through online payments, automation, and streamlined digital workflows.

If you are looking for structured Zoho expertise backed by an established consultancy, you can contact Ascent Business Solutions on 0121 392 8140 (UK), email info@ascentbusiness.co.uk, or visit https://www.ascentbusiness.co.uk.
Zoho CRM: Client Script Confirmation Box and Popup Mailer

Zoho CRM: Client Script Confirmation Box and Popup Mailer

What?
This is an article just repeating a script from the Zoho Kaizen series allowing a confirmation box (something lacking in Zoho Creator - but that every app outside of Zoho has) as well as a popup to email from CRM with a rich-text interface.

Why?
The use-case here is non-existent. It's more of a play around to see what can be achieved and how much this can be customized. The task I've set for myself is as follows:
  • Trigger if the contact record has a tickbox called "Extra Confidential" ticked/checked=true
  • Popup a confirmation box to proceed or cancel.
  • Popup the email from CRM mailer with the to email address, bcc, subject and message content already populated.

How?
The example from the Kaizen series uses a record with canvas mode applied; but I wanted to try it without a canvas to see if we can have this functionality using the out-of-the-box ZohoCRM.

Client Script Configuration:
  1. Login to ZohoCRM as a system administrator and go to the Setup page (cog icon in the top right next to the profile image)
  2. Under "Developer Hub" go to "Client Script"
  3. Click on "New Script" button (the blue one - not the "Add Script" grey one)
  4. Give the client script a name, I'm calling mine "Extra Confidential"
  5. Keep Category=Module, set Page=Detail Page (Standard), set Module=Contacts and set the layout if you want.
  6. Under Event Details, set Type=Page Event; Event=onLoad
  7. Click on "Next"
  8. Give it the following code:
    copyraw
    // attempt 
    try {
    
        // get the ID of this record 
        var v_ThisRecordID = $Page.record_id;
    
        // get the full name of this contact (not sure why this returns both first and last)
        var v_ContactName = ZDK.Page.getField('Last_Name').getValue();
    
        // get the email of this contact
        var v_ContactEmail = ZDK.Page.getField('Email').getValue();
    
        // get the value of the custom boolean/checkbox field "Extra Confidential"
        var b_ContactConfidential = ZDK.Page.getField('Extra_Confidential').getValue();    
    
        // if this is a sensitive record, ie "Extra Confidential" has been ticked
        if (b_ContactConfidential) {
    
            // prompt with a confirmation box
            var b_Proceed = ZDK.Client.showConfirmation('Do you want to open the mailer window?', 'Proceed', 'Cancel');
    
            // if both "Extra Confidential" is ticked and confirmation was Yes/true then proceed
            if (b_Proceed) {
                ZDK.Client.openMailer({ from: '', to: [{ email: v_ContactEmail, label: v_ContactName }], bcc: [{ email: This email address is being protected from spambots. You need JavaScript enabled to view it.', label: 'Copy for myself' }], subject: 'Greetings from the Joel Lipman team!', body: '<span style=\'font-size:12pt;\'>Hi there!<br /><br />I\'m the very model of a modern major general.<br /><br />Bye.<br /><br />the Team.</span>' });
            }
        }
      
    } catch (e) { 
      
         // return error (don't display it, just show it in the logs) 
        console.log(e); 
         //ZDK.Client.showMessage("Client Script error"); 
    }
    1.  // attempt 
    2.  try { 
    3.   
    4.      // get the ID of this record 
    5.      var v_ThisRecordID = $Page.record_id; 
    6.   
    7.      // get the full name of this contact (not sure why this returns both first and last) 
    8.      var v_ContactName = ZDK.Page.getField('Last_Name').getValue()
    9.   
    10.      // get the email of this contact 
    11.      var v_ContactEmail = ZDK.Page.getField('Email').getValue()
    12.   
    13.      // get the value of the custom boolean/checkbox field "Extra Confidential" 
    14.      var b_ContactConfidential = ZDK.Page.getField('Extra_Confidential').getValue()
    15.   
    16.      // if this is a sensitive record, ie "Extra Confidential" has been ticked 
    17.      if (b_ContactConfidential) { 
    18.   
    19.          // prompt with a confirmation box 
    20.          var b_Proceed = ZDK.Client.showConfirmation('Do you want to open the mailer window?', 'Proceed', 'Cancel')
    21.   
    22.          // if both "Extra Confidential" is ticked and confirmation was Yes/true then proceed 
    23.          if (b_Proceed) { 
    24.              ZDK.Client.openMailer({ from: '', to: [{ email: v_ContactEmail, label: v_ContactName }], bcc: [{ email: This email address is being protected from spambots. You need JavaScript enabled to view it.', label: 'Copy for myself}], subject: 'Greetings from the Joel Lipman team!', body: '<span style=\'font-size:12pt;\'>Hi there!<br /><br />I\'m the very model of a modern major general.<br /><br />Bye.<br /><br />the Team.</span>' })
    25.          } 
    26.      } 
    27.   
    28.  } catch (e) { 
    29.   
    30.       // return error (don't display it, just show it in the logs) 
    31.      console.log(e)
    32.       //ZDK.Client.showMessage("Client Script error")
    33.  } 

Output
  1. Zoho CRM: Client Script Confirmation Box and Popup Mailer: Confirmation Popup
  2. Zoho CRM: Client Script Confirmation Box and Popup Mailer: Email Popup

Source(s):


Category: Zoho CRM :: Article: 396

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com