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: ZDK Client Script: Auto-Select Pipeline based on User Department

Zoho CRM: ZDK Client Script: Auto-Select Pipeline based on User Department

What?
A super quick article on how to pre-select the pipeline on deal creation within CRM based on the department specified on a user's profile.

Why?
A client asked that when staff create a deal/opportunity record in CRM, the pipeline is automatically pre-selected based on the user.

How?
So there's a bit of a pre-amble for setting up the fields, we'll then use a client script to automatically read the user's record, retrieve the department, and set the correct pipeline option.

Setup: Department Field on User Profile
  1. Login to ZohoCRM as a system administrator > Go to Setup > Users > Click the pencil icon (top-right most) to edit any profile
  2. On the user's dialog/popup in the bottom left, there will be a link saying "Manage Fields"
  3. Add a picklist field type called "Department" with the options "Hire Team", and "Sales Team".
  4. Save and Close

Setup: Specify Pipeline Options
  1. Login to ZohoCRM as a system administrator > Go to Setup > Pipelines
  2. Using the "Standard" layout, let's simply create a new pipeline by clicking the button in the top right.
  3. For this demo, we ensure there are at least 2 pipelines: "Hire Pipeline", and "Sales Pipeline".

Setup: the Client Script
  1. Login to ZohoCRM as a system administrator > Go to Setup > Client Script
  2. Clicking on the "New Script" button in the top right.
  3. For this demo, we give it the name "On Deal Creation" and in the description I've commented that this will select a pipeline based on the user's department.
  4. Category is "Module", Page is "Create Page", and Module is "Deals"
  5. Event Type is "Page Event" and Event is "onLoad".
  6. Give it the code:
    copyraw
    var r_User = ZDK.Apps.CRM.Users.fetchById($Crm.user.id);
    var r_Field = ZDK.Page.getField('Pipeline');
    
    if (r_User.Department == "Sales Team") {
        r_Field.setValue("Sales Pipeline");
    } else {
        r_Field.setValue("Hire Pipeline");
    }
    1.  var r_User = ZDK.Apps.CRM.Users.fetchById($Crm.user.id)
    2.  var r_Field = ZDK.Page.getField('Pipeline')
    3.   
    4.  if (r_User.Department == "Sales Team") { 
    5.      r_Field.setValue("Sales Pipeline")
    6.  } else { 
    7.      r_Field.setValue("Hire Pipeline")
    8.  } 
  7. Save and Close

Issue(s) Encountered
  • Using the CS IDE Run: This can't run ZDK Apps.CRM.Users (this can't read any module)... Simply save the above code and test it using the CRM and not the IDE.


Category: Zoho CRM :: Article: 389

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