For Zoho Services only:

I'm actually part of something bigger at Ascent Business Solutions recognized as the top Zoho Premium Solutions Partner in the United Kingdom.

Ascent Business Solutions offer support for smaller technical fixes and projects for larger developments, such as migrating to a ZohoCRM.  A team rather than a one-man-band is always available to ensure seamless progress and address any concerns. You'll find our competitive support rates with flexible, no-expiration bundles at  For larger projects, check our bespoke pricing structure and receive dedicated support from our hands-on project consultants and developers at

The team I manage specializes in coding API integrations between Zoho and third-party finance/commerce suites such as Xero, Shopify, WooCommerce, and eBay; to name but a few.  Our passion lies in creating innovative solutions where others have fallen short as well as working with new businesses, new sectors, and new ideas.  Our success is measured by the growth and ROI we deliver for clients, such as transforming a garden shed hobby into a 250k monthly turnover operation or generating a +60% return in just three days after launch through online payments and a streamlined e-commerce solution, replacing a paper-based system.

If you're looking for a partner who can help you drive growth and success, we'd love to work with you.  You can reach out to us on 0121 392 8140 (UK) or  You can also visit our website at

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

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.

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

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:
    var r_User = ZDK.Apps.CRM.Users.fetchById($;
    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($
    2.  var r_Field = ZDK.Page.getField('Pipeline')
    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 :: Article: 860

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

Related Articles

Joes Revolver Map

Joes Word Cloud


Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Donate to Joel Lipman via PayPal

Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF
© 2024 Joel Lipman .com. All Rights Reserved.