Tip #8 Auto-notify team via a Zoho Cliq bot whenever a sales order is created manually

Tip #8 Auto-notify team via a Zoho Cliq bot whenever a sales order is created manually

Hello again,


Hope this post finds you in good health.

Last time we saw how to apply a preset credit card charge to your sales orders . This week, we will see how we can notify ourselves through a bot inside of Zoho Cliq whenever someone in our organization makes an offline/manual sales order in Zoho Inventory.

How does this work?

A user drafts a sales order or an offline order within Zoho Inventory, which then triggers a message containing the name of the customer and the sales order number (or whatever message content as given or edited by you) is transmitted to a particular bot inside of Zoho Cliq (bot choices can be configured within the custom function). This bot will then post a notification within Zoho Cliq immediately, allowing your fulfilment team to start working on it without delay. 

Prerequisites:


Set up process:
  • Open the Zoho Inventory organization.

  • Click on the gear icon from the top-right corner. 

  • Select Automation from the drop-down.

  • Now click on the button adjacent to +New Workflow Rule.

  • Out of the four options from the drop-down, select Custom Functions.

  • Now let's add a name to this workflow rule and make sure that there are no spaces between words.

  • Select Sales Orders against Module.

  • Add a Description if you need one.

  • Now, the workflow type is going to be Event Based.

  • The condition to set shall be, "when a Sales Order is created".

  • Now copy and paste this code snippet inside the deluge pane:

authtoken = "XXXXXXXXXXXXXXXXX"; //cliq authtoken
salesorderID = salesorder.get("salesorder_id");
salesorderdate = salesorder.get("date").toDate();
organizationID = organization.get("organization_id");
customername = salesorder.get("customer_name");
info customername;
payload = Map();
str = "Sales order " + salesorder.get("salesorder_number") + " for " + customername + " has been created. ";
info str;
payload.put("text",str);
res = postUrl("https://cliq.zoho.com/api/v2/bots/YOURBOTLINKNAME/message?authtoken=" + authtoken,payload + "");

  • Navigate to the first line - authtoken = "XXXXXXXXXXXXXXXXX"; and replace the XXXXXXXXXXXXXXXX inside of the double quotes with the authtoken number that you have generated from Zoho Cliq (see prerequisites for instructions).

  • You can also write your own custom message/modify notification content by navigating to the 8th line that says - str = "Sales order " + salesorder.get("salesorder_number") + " for " + customername + " has been created. ";.

  • Now to link the code with the appropriate Zoho Cliq bot, navigate to the last line -  res = postUrl("https://cliq.zoho.com/api/v2/bots/YOURBOTLINKNAME/message?authtoken=" + authtoken,payload + ""); and replace this link with the one from your bot inside of Zoho Cliq. To get your very own bot link for this step:

    • Open Zoho Cliq in a new window.

    • Navigate to the bot you have created for this purpose.

    • When you click upon it, you will spot a URL below its name in the pop-up window. Copy the URL and replace the above URL with the one from the bot. 

  • Hit Save to finish.


Hence forth, whenever someone creates a sales order, your Zoho Cliq bot will notify you and all those it can reach immediately. Hope this helps you with your sales endeavours. If you have any questions, please comment below or write an email to support@zoho-inventory.com (while mentioning Tip #8 in the subject). Someone will get in touch with you.

Until next time.

Your everyday end user,
Ajay Aadhithya Chandrasekaran
Zoho Inventory