Function-2: Round-Robin assignment of records

Function-2: Round-Robin assignment of records


Welcome back folks!

Last week, we saw how to update sales commission in quotes using a custom function. This week, let's see an interesting use case asked by many of you - auto-assignment records by round-robin method.

Business scenario:

Right now, the solution allows you to auto-assign leads from web form and imported lists. Let us look at a need where you want to auto-assign leads from in-bound calls in a round-robin method, across modules.

Prerequisite: You must create a permanent record in the specific module, leads in this case and assign that record to the first user in round-robin.

Here’s how you add this custom function to your CRM account:
  • Go to Setup>Automations>Actions >Custom Functions > Configure Custom Function > Write your own.
  • Enter the name of the Custom function. For example: “Round-robin assignment”.
  • Select the module as Quotes. Add a description(optional).
  • Click “Free flow scripting”.
  • Copy the code given below.
  • Click “Edit arguments”.
  • Enter the name as “leadId” and select the value as “Lead Id”.
  • Click Save.

As you have created a permanent record, this function does the assignment on a round-robin basis without errors. Note that the function won’t work if you don’t create a permanent record .

The script:

Code for Version 2.0 API:
 
firstRefRecordDetails = zoho.crm.getRecordById("Leads", xxxxxxxxxxxxx);
firstOwner = ifnull(firstRefRecordDetails.get("Owner"),"").get("id");
if (firstOwner = "User_ID_1")
{
UpOwner = "User_ID_2";
}
if (firstOwner = "User_ID_2")
{
UpOwner = "User_ID_1";
}
updatefirstRef = zoho.crm.update("Leads", "xxxxxxxxxxx".toLong(), { "Owner" : UpOwner.toLong() });
info updatefirstRef;
mp = map();
mp.put("Owner", UpOwner.toLong());
updateResp = zoho.crm.update("Leads", leadId.toLong(), mp);
info mp;
info updateResp;


Code for Version 1.0 API:

leadIdStr = input.leadId.toString();
firstRefRecordDetails = zoho.crm.getRecordById("Leads", xxxxxxxxxxxxx);
firstOwner = ifnull(firstRefRecordDetails.get("SMOWNERID"),"");
if (firstOwner = "User_ID_1")
{
UpOwner = "User_ID_2";
}
if (firstOwner = "User_ID_2")
{
UpOwner = "User_ID_1";
}
updatefirstRef = zoho.crm.updateRecord("Leads", "xxxxxxxxxxx", { "SMOWNERID" : UpOwner });
mp = map();
mp.put("SMOWNERID", UpOwner);
updateResp = zoho.crm.updateRecord("Leads", leadIdStr, mp);
info mp;
info updateResp;

—————————————————————————————————————————

Note:
  • Replace 'xxxxxxxxxx' with the permanent record id mentioned in the pre-requisite.
  • The above code is an example for assigning the records in the Leads module. You can use this code for any other module by changing the module name and parameters. 
  • Assigning to a user requires the User ID and not the user name. The user ID is found in the Setup page of your CRM. Take a look at the screenshot below for more details.


Do try this out and let me know how it worked. If you have questions, ask away. Share this with your team if you think they'll find this useful. See you all next week with another interesting custom function in this series. Until then !

Update: As you must be aware, API V1.0 will be deprecated and support for version 1.0 API will be available only till Dec 31, 2018. Version 1.0 compatible Functions will continue to work until Dec 31, 2019. You're advised to migrated to API Version 2.0 at the earliest. Check this announcement for more. We've updated the post to include the Version 2.0 compatible Function.
    • 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
    • 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,
    • Function-2: Round-Robin assignment of records

      Welcome back folks! Last week, we saw how to update sales commission in quotes using a custom function. This week, let's see an interesting use case asked by many of you - auto-assignment records by round-robin method. Business scenario: Right now, the solution allows you to auto-assign leads from web form and imported lists. Let us look at a need where you want to auto-assign leads from in-bound calls in a round-robin method, across modules. Prerequisite: You must create a permanent record in the
    • Recent Topics

    • How to Use Branch-Specific Templates for Invoices Created via Zoho Books invoice API?

      I am using the Zoho Books Invoice API and I am sending the branch_id when creating an invoice. The invoice is being generated, but it is using the default template rather than the template that corresponds to the branch I specified. In Zoho Books, when
    • Automatic Department and Employee Sync Between Zoho One and Zoho People

      Dear Zoho Support, I'm writing to propose a valuable feature request that would streamline data management and improve user experience within the Zoho ecosystem: automatic synchronization between departments and employees in Zoho One and Zoho People.
    • Delete Unactive Users form Directory

      Hi, how to delete all unactive users ?
    • Manual Journal entry problem

      Hi, all my manual Journal entries are not reflected in my general ledger. i have check to see if the entry were done correctly and everything is fine. Please help me
    • Changing Related Modules in a Report

      Once a report is created, is it possible to add Related Modules? David Shalev | Chief Revenue Officer | 800 558 9130 davids@splitit.com | www.Splitit.com
    • Is there a way to limit/turn off unlimited Version History?

      We save CAD files in our Zoho WorkDrive and while the files aren't very big themselves, whenever someone hits the save button in the CAD program it uploads another version of the file to the WorkDrive. This means files that are only a few MBs in size can actually be taking up 10s of GB in our WorkDrive if someone is saving frequently. Is there a way to limit the number of versions WorkDrive stores to save WorkDrive space?
    • ZOHO One Webinar Functionality

      I am currently trialling ZOHO Projects and have also been looking into over a dozen different Webinar solutions from various vendors. I understand that ZOHO Webinars is a stand alone tool. But that ZOHO Meetings also offers webinar functionality. The
    • Avoid None option in List Custom Fields

      Does anybody know a way to avoid -- None --  option to be displayed in a List Custom Field?  - With Mandatory option selected, you can prevent from saving if user select --None-- value. - With Default value selected, a different value than --None-- is
    • How do I modify the the incoming/current call popup? I can modify other call pages but not that one.

      I want to modify the incoming and active call popup on the crm to include customer relevant information, such as purchase history or length of relationship. Under modules and fields, I don't seem to see active call as a choice to modify, only the main
    • JavaScript or iframe embed with transparent background

      If I have a form with transparent Wallpaper, it appear great on my website by using my default background. However, using Zoho Forms SAVE button, the user is directed to Zoho Forms managed page and a blank background. Alternatively, I can include a Wallpaper
    • Emails and Kanban for Portals

      There was talk portals would have emails and email templates, and kanban view. Is there any release date for this? Portals has been so good for offering a simple crm option. It just needs a couple of small things.
    • Custom sorting Axis in a Heatmap report

      I have a heatmap and want to sort the order of the axis in a custom priority order - is this possible ? So I want the priority to be "New, Urgent, High, Medium, Low, Not Set, Unknown" Can I set this manually ?
    • The 3.1 biggest problems with Kiosk right now

      I can see a lot of promise in Kiosk, but it currently has limited functionality that makes it a bit of an ugly duckling. It's great at some things, but woeful at others, meaning people must rely on multiple tools within CRM for their business processes.
    • Zoho People down

      Zoho People (EU) appears to be inaccessible this morning. Have gotten through log-in and MFA but have been on the "Please wait while we work our charm..." page for several minutes now. A colleague has tried to access it via the One dashboard and experienced
    • Adding Bluesky channel

      Hello, Is Bluesky (AT protocol) soon added on Social ? Bluesky is being developped and is now open to anyone (no more invitation) Thank you
    • No Zoho Support on the weekends or after hours?

      Zoho Support is only available Monday - Friday during normal business hours. My business (as does many businesses) operates 7-days a week. Last Saturday, I had a client come in and in order for me to help her, I needed to log into CRM but to my surprise,
    • How do I overcome the 800 transaction rule limit?

      I just received a message: "You have reached the maximum rule limit of 800." I searched the documentation, and I didn't find anything about the cap or limit. I asked the ZOHO Books team if there is a way to increase the limit. Their answer was: "Please
    • Search functionality in Vault is very poor

      Hi Zoho Team Please... the search functionality is absolutely vital in Vault, particularly when it's being used by a team. It's just a fact of life that everybody has their own way of naming something, so using exact match on the Password name is horribly
    • 👋 Pessoal, como está sendo sua experiência com ferramentas de produtividade?

      Percebo que muitos usuários de soluções como Google Workspace e Microsoft 365 acabam enfrentando desafios quando pensam em migrar de plataforma, especialmente por conta de multas contratuais ou até pela complexidade em adaptar as equipes. Além disso,
    • Quais são os maiores desafios que você enfrenta ao implementar o Zoho CRM?

      Olá, pessoal da comunidade Zoho Brasil! Sou parceiro autorizado da Zoho e, ao longo do tempo, tenho notado que cada implementação de CRM traz desafios únicos, dependendo do segmento de negócio, das metas da empresa e até da familiaridade da equipe com
    • Parent - Child Ticket Twins

      I think i maybe losing my mind. Are these two completely separate parent-child ticketing functions? I think I remember adding a plugin years ago and I think I also remember seeing something about parent-child ticketing in a release notes being added.
    • Can the Comments from approval process be posted onto a module field and not on the timeline?

      I have set up approval process for the quotations module and would like for the approval comments to be posted onto a module field as opposed to me searching for the particular quote and going to the timeline section. This would also help keep tabs on
    • auto reply shopify order details in zoho desk based on order number in subject using deluge script custom function

      auto reply shopify order details in zoho desk based on order number in subject using deluge script custom function
    • Is there an ability to keep the status field unlocked while having an active blueprint?

      Hi. Is there an ability to keep the status field unlocked while having an active blueprint? Here is the case. We have a transition let's say "Ask to the customer" When we do this transition the Status is switch to "waiting for customer" But if for exemple
    • Rename Category and Sub Category fields

      Is it possible to rename the field labels for Category and Sub Category - if so can this be done at layout or department level ?
    • Thoughts on users being able to create Zoho accounts?

      For anyone who's used Zoho for a while, I'm sure you've come up against an issue where you create an account for a user, and they go ahead and sign up for a new one accidentally. Then, only they can delete the account, as it exists outside the organisation.
    • Deluge should permit a connection to be set with a variable

      Hello, Being one who occasionally likes to post code in the forums, I try to make anything that the end user needs to define be present at the very top of the script so that those who want to implement the script won't have to hunt through lines of code,
    • Bcc option in "new ticket --> send as email" disappeared

      Is it just me or did the bcc option disappear in the "send as email" option of new tickets in desk? This is very inconvenient.
    • Automated Intercompany Transaction

      Hello team - expecting a support today. I have some good experience with Zoho products as an accountant and trying to introduce the Zoho to my newly joined company. So far it's going on good except below question. I'm currently maintaining multiple companies
    • change subscription within customer portal

      Would be great for the customer to be able to change their own subscription (or restart existing one) within the customer portal. Also, would like to be able to have early termination fee on subscriptions if canceled early.
    • How to Automate Form Creation and Workflow Setup in Zoho Creator?

      Does anyone have ideas on how to create a form workflow that can perform the following functions automatically when a new submission is received for the existing form? Create a new form and report Create a new page Generate a new form workflow for the
    • How can i use edit url in the html snippet dynamically using parameter ? after clicked on that value

      after clicked on that value ..  How can i use edit url in the html snippet dynamically using parameter ?  for each record their corresponding record will open..  Can we have sample url for the same ?
    • Sales without Invoice refund

      I have a sales without invoice in my stripe account from April. This is a double entry as the customer paid the invoice and that was recorded in Stripe. I cannot delete it as it was included in a VAT return. I need to remove it or refund it to balance
    • Updating sum of subform

      I encountered another problem for updating of sum of fields in a subform. on a main form (Make_claim), I have a dynamic drop down (approved_budget_purpose) list to which filters the the items display in a subform (expense_claim_history1). In the subform,
    • IP Addresses for Whitelist

      Hi,  Where can I get a list of the IP addresses I need to whitelist for accessing Zoho Desk? TIA
    • Ability to rename community tabs as own preference

      Current zoho desk community tabs unable to rename however i see it has as suitable standard for most communities But it will be more better and beneficial if possible to modify(rename) then we can use the community for various purposes and able to change them as very convenient for, various product & services various fields organizations push(add) many topics types into one community instead host several community forums or portals. Setup > Channels > Community > Preference > Topic Type This's an
    • How to a customise the support email id to our custom domain

      we need to have support email address in our custom domain email id. how to do it?
    • Enhanced Anti-Spam Capabilities for Zoho Desk

      Dear Zoho Team, We appreciate the existing feature in Zoho Desk that detects and automatically marks suspicious email tickets as spam, moving them to the spam tickets view. Additionally, the ability to auto-mark associated contacts as spam is helpful.
    • How to Associate multiple contacts with deal in Sales Inbox

      Hello, I have many deals that have multiple potential customers associated with a single deal, for example an engineer and a manager. The manager is the Deal's primary contact in CRM and the Engineer is added to the deal in the "Contact Roles" Associated
    • Trying to sort tickets in "Status" mode by age

      Struggling with an odd issue, hoping someone can help. Trying to use the basic "Status" ticket-view, but can't find the setting that will put the oldest tickets at the top of each "Status" column. I found this in other ticket-view options (classic, compact,
    • Next Page