Hello,
Open your Zoho Inventory organization.
Navigate to Settings using the gear icon from the top-right corner.
Select Automation from the sidebar. 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 Purchase 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 Purchase Order is" "Created or Edited".
Function shall be executed "When any field is updated".
And set the frequency of execution to "Everytime".
Next, you are required to set two triggers that can execute this custom function. You can do so by clicking on the Apply Advanced Filter option below the workflow condition.
Trigger 1: "When" the "Purchase Receive Status" "is" "Partially Received".
Trigger 2: "Or" when the "Purchase Receive Status" "is" "Received".
Now copy and paste this code snippet into the deluge pane:
purchaseorderID = purchaseorder.get("purchaseorder_id");
Don't forget to navigate to the line containing the authtoken within the code snippet and replace the XXXXXXXXXXX with the auth token number that you had generated in the first step.
To send this notification to one or more dedicated email addresses instead of the vendor, you can do that by navigating to this line:
to : vendoremail //EMAIL ID
And replace vendoremail with one or more email addresses of your choice like "abc@xyz.com, def@xyz.com"
Hit Save to finish.