Tip #6.2 Notify vendors of the remaining goods you are yet to receive.

Tip #6.2 Notify vendors of the remaining goods you are yet to receive.

Hello again,

In part 1, we saw how we could notify vendors of successful deliveries made by them. Here, we will see how we can notify vendors of purchased items that we are yet to receive, whenever these vendors make partial deliveries.

How does it work?

Let's suppose you order items A (20 pcs) and B (35 pcs) from a vendor. Now the vendor delivers only 15 pcs of A and 7 pcs of B to your warehouse. When you record a purchase receive for these items, the custom function will automatically send out an email notification to the vendor telling them that they are yet to deliver 5 pcs of A and 28 pcs of B. Similarly, the vendor will be informed of all "yet to arrive items" until all of them have been received by you. 

Setting up the custom function:

Log in to your Zoho account and click on this link to generate an Auth Token which is required to make this work.
  • 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".

  • Click on the Apply Advanced Filter option.

  • The trigger to execute this function shall be: "When" the "Purchase Receive Status" "is" "Partially Received".

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

purchaseorderID = purchaseorder.get("purchaseorder_id");

purchaseorderdate = purchaseorder.get("date").toDate();
organizationID = organization.get("organization_id");
ponum = purchaseorder.get("purchaseorder_number");
vendorID = purchaseorder.get("vendor_id");
res = invokeurl
url :"https://inventory.zoho.com/api/v1/purchasereceives/editpage?purchaseorder_id=" + purchaseorderID + "&organization_id=" + organizationID + "&authtoken=" + authtoken
type :GET
po = res.get("purchaseorder");
//info po;
prdet = po.get("line_items").toList();
//info prdet;
i = 1;
lineitems = purchaseorder.get("line_items");
for each det in prdet
if(det.get("quantity_ordered").toDecimal() != det.get("quantity_received").toDecimal())
iid = det.get("item_id");
for each line in lineitems
if(iid == line.get("item_id"))
sku = line.get("sku");
prate = line.get("rate");
info sku;
info prate;
str = str + "<br>";
str = str + "<br>";
str = str + i + ".";
str = str + " " + det.get("name");
str = str + " " + " " + "[ SKU : " + sku + " ] ";
str = str + "-";
str = str + " " + " ";
tbr = det.get("quantity_ordered").toDecimal() - det.get("quantity_received").toDecimal();
str = str + " Quantity : " + tbr.toString();
i = i + 1;
//info str;
// info vendorID;
resp = invokeurl
url :"https://inventory.zoho.com/api/v1/contacts/" + vendorID + "?authtoken=" + authtoken + "&organization_id=" + organizationID
type :GET
cont = resp.get("contact");
contactdet = cont.get("contact_persons").toList();
//info contactdet;
for each deta in contactdet
vendoremail = deta.get("email").toString();
info vendoremail;
from :zoho.adminuserid
to : vendoremail //EMAIL ID
message :str
info "all received";
  • 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.

Hope this helps in reducing your product wait time and improves your relationship with your vendors.

Until next time.

Your everyday end user,
Ajay Aadhithya Chandrasekaran
Zoho Inventory

    Zoho Pagesense Resources

        Zoho SalesIQ Resources

              Zoho TeamInbox Resources

                Zoho DataPrep Resources

                    Zoho CRM Plus Resources

                      Zoho Books Resources

                        Zoho Subscriptions Resources

                          Zoho Desk Resources

                            Zoho Projects Resources

                              Zoho Sprints Resources

                                Qntrl Resources

                                  Zoho Creator Resources

                                    Zoho WorkDrive Resources

                                        Zoho Campaigns Resources

                                          Zoho CRM Resources

                                                      Design. Discuss. Deliver.

                                                      Create visually engaging stories with Zoho Show.

                                                      Get Started Now