Tip #3 Automating total item weight calculation for your sales orders in Zoho Inventory

Tip #3 Automating total item weight calculation for your sales orders in Zoho Inventory

Hello,


Hope the day is treating you well.
Last week, we saw how we could automate the calculation of total shipping charges from numerous shipments for your sales orders and invoices. This week, we will see how you can automate the calculation of total item weight for your sales orders. 

How does this work?
First, you are required to capture the weight of all your items using a custom field. And when you create a sales order, you can either have the system display the individual weights for you or you can manually enter new weights. You are also required to define a custom field under sales orders and packages called Weight to capture the total package weight. Through the custom function, the system will then add up the individual weights of items to arrive at a total weight and display it on your sales orders and packages. Later when you ship via a carrier, you can refer manually to this weight and input them into the shipment order to generate shipping rates.

Note: This custom function works only if a sales order has a single package. If there are multiple packages, then please note that this function will display the total weight of all items in the sales order inside of every package and not the total weight of items present inside that package. 

What do you need before writing the custom function?

How do I set it up?

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 for this workflow rule and make sure that there are no spaces between words.

  • Choose "Sales Orders" against the module field.

  • Add a description if you need one.

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

  • And for the trigger, we are going to choose the option - "when a Sales Order is created".

In the deluge pane, we are going to copy and paste the following code snippet:


authtoken = "Copy and paste your authtoken here";
salesorderID = salesorder.get("salesorder_id");
salesorderdate = salesorder.get("date").toDate();
organizationID = organization.get("organization_id");
bson=Map();
lineitems=salesorder.get("line_items").toList();
weight=List();
for each line in lineitems
{
cfs=line.get("item_custom_fields").toList();
for each cf in cfs
{
if(cf.get("label").toString().equalsIgnoreCase("weight")) /*replace with item level custom field name*/
{
weight.add(cf.get("value").toDecimal() * line.get("quantity"));
break;
}
}
}
wei=0;
j=0;
for each index j in weight
{
wei=wei + weight.get(j).toDecimal();
}
info wei;
cf=List();
cf1=Map();
cf1.put("label","Weight"); /* replace with sales order custom field */
cf1.put("value",wei);
cf.add(cf1);
customs=salesorder.get("custom_fields").toList();
customs.addAll(cf);
bson.put("custom_fields",customs);
bson.put("customer_id",salesorder.get("customer_id"));
res=zoho.inventory.updateRecord("SalesOrders", organizationID,salesorderID, bson);
info res.toMap().get("message");

  • Before you save, you are required to copy and paste your auth token inside the quotes in the 1st line that says:

    • authtoken = "Copy and Paste your auth token in place of this text";

    • The auth token is a critical piece of information that helps the system identify you, so keep yours safe and confidential. Do not share it with anyone, not even folks from Zoho.

  • Now, hit Save to finish.

Henceforth, the total weight of all your items in a sales order you make will be calculated automatically and updated to the package that is associated with it. 

Don't use this, if you have multiple packages for a single order.


Hope this makes shipping a little more easier for you. Have you tried custom functions for your business? Email us your recipes (scenarios and code snippets), questions and suggestions to support@zoho-inventory.com.


Until next time!


Your everyday end user,

Ajay Aadhithya Chandrasekaran

Zoho Inventory



      • Recent Topics

      • Move a Contact from Current Account to a NEW Account

        I do not believe the functionality to Move a Contact from a Current Account to a New Account is not available. Please someone tell me I am missing something! I have been through designing, developing, using and selling CRM systems for over 25 years and had this functionality20+ years ago in other CRMs.  In the real world people move from one organisation to another. In the sales, finance and technical world it is nice to see the communication history with that person in their old account and also
      • Force Specific Layout for CRM Contacts Portal

        Hello: We're in trial on ZOHO One and looking at the CRM Portal (just for the contacts module). We have a client layout set up for Contacts that is working well for our internally, but for the portal we don't want to require (make mandatory) some of the
      • How to refresh the page by widget in related list?

        Hello, ZOHO.CRM.UI.Popup.closeReload method does the thing I need. But in my case, I'm not using popup. I have a widget in related list and I want to refresh the page when I'm done with it. I searched for it but I wasn't able to find it. Is there an any
      • Automatic Removal of Departments and Groups for Inactive Employees in Zoho One

        Hi Zoho One Team, We hope you're doing well. Currently, when an employee is marked as inactive in Zoho One, they remain listed as a member of their department and associated groups. This creates a challenge in maintaining accurate records and ensuring
      • Zoho Sheets not compatible with Excel/Google Sheets

        In order to share a copy of a Zoho sheet with someone that does not use Zoho, it must be downloaded as MS Excel format and then added to an email.  This is a labor intensive, and frankly confusing process.  I have forgotten to do this before, only to
      • Change eMail Template for Event-Invitations

        Hello ZOHO-CRM Team How I can change the eMail Template for Event-Invitations? I work with the German Version of the Free Version. I know how I can modify eMail alerts or Signature Templates, but where I can other eMails modify you send out? Thank you for your answer. Regards, Juerg
      • Zoho Social integration with Zoho Flow

        Is there any plans for Zoho Social integration with Zoho Flow?
      • Zoho CRM Widget and translations

        Hi everyone! We're building a Widget with zoho-extension-toolkit, how is localization supposed to work? "zet init" created a translations/en.json file, but what should go inside it and how is it supposed to be accessed from the Widget/javascript? Thanks
      • Bienvenue à Zoho FSM : l'optimisation des opérations locales qui offre une expérience de service impeccable

        Nous sommes ravis de vous présenter Zoho FSM, la plateforme de gestion des services terrain de bout en bout. Les solutions de gestion des services locaux s'adressent aux organisations qui effectuent des activités d'installation, de réparation et de maintenance
      • Adding tag to specific record as an acion in a workflow

        Hi! I've created the following workflow in the module 'Leads'. When a record meets the criteria, there should be a tag added to the specific record in the module 'Contacts'. In the module 'Leads', there is a look-up field named 'Kandidaat' which is connected
      • Trying to catch error with ZOHO.CRM.HTTP.get (Response Code)

        Hello, I'm trying to get response header from ZOHO.CRM.HTTP.get, in order to catch error like 404 or something else but it seems that ZOHO.CRM.HTTP.get() method only returns the body of the response, and I see no way to access the headers returned. Is
      • FSM - How to ADD PHOTOS to Estimates & Invoices

        How can you add photos to estimates and invoices that are being emailed to the client so the can see what you are estimating and your completed work?
      • Free developer edition of Zoho CRM

        A question for Zoho and other developers: How can you set up a demonstration version of a Zoho CRM implementation to show employers/clients what can be achieved? Do you pay for Zoho CRM Enterprise/Zoho One for this purpose? Does Zoho offer a free version
      • "notes"-field in a task to full width?

        Hi, Is there someone that can tell me how to adjust the "notes"-field in a task, to full width? I already played around with 1 or 2 columns, but this has nu effect on the standard width. Thx in advance for your help. Cheers, Ralph.
      • Can I add Conditional merge tags on my Templates?

        Hi I was wondering if I can use Conditional Mail Merge tags inside my Email templates/Quotes etc within the CRM? In spanish and in our business we use gender and academic degree salutations , ie: Dr., Dra., Sr., Srta., so the beginning of an email / letter
      • Where are scheduled emails stored?

        After you schedule an email to go out through the CRM, how do you go about changing that scheduled email? Or even where can I see the list of emails scheduled to go out? They are not listed in my Zoho Mail account in Outbox which has been the only answer
      • CRM Home Page Dashboard, how can i add zoho desk cases?

        How can i see which tickets are in my group as a dashboard component on the home tab in zoho crm? I don't see any way of adding this.
      • Custom Module missing SDK function fetchRelatedRecords(...) in a Client Script

        Good day, We have added a new module with a Multi-Lookup relation to Contacts.  When we tried to use the fetchRelatedRecords(id, related_list_api_name) function to get Related Records it is missing for our new custom module. https://js.zohocdn.com/crm/5124797/documentation/DotSDK/Modules.html
      • Subform Client Script

        Good day,  I have a subform where users can subscribe to various magazines. I would like to prevent the user from selecting the same magazine twice when adding a new row. Is there a way to prevent the user from doing this? (Can it be done via a client
      • Checklist/ save to onedrive/ a group of items invoicing in Zoho FSM

        hi, is there a way to add a specific checklist to any WO without passing eachtime by the model customization? can we save file such picture directly in our sharepoint ak onedrive? is there any way to add a group of item pre defined to make invoicing easier
      • Introducing 'Queries' In Zoho CRM

        Hello everyone! We are here with an exciting feature - Queries in Zoho CRM! A little context before we dive right into the feature specifics :) In today’s fast-paced business environment, immediate access to relevant data is essential for informed decision-making.
      • Serious question: Are there actually "solo-preneurs"/small business owners who made Zoho-one work well for them?

        L.S. After already many years of continued struggle with Zoho-One, I am seriously wondering if there are actually solo-preneurs (one person small business owners - without a large, dedicated IT dept.) who got it (Zoho-One) to work well for their businesses.
      • Calendar Bookings in Recruit

        Hi there, We have recently started using Zoho recruit and although it has some great functionality there are a few gaps that are causing real headaches. One of those being how interviews are scheduled. The majority of our hiring managers are field based
      • Getting Error : Developer Tool Detected

        Hi Team, Getting the error during open the portal, error attached on the same ticket. Please check and help us to resolve the same.
      • Send Zoho Creator Template by Email or sendemail

        Hello All Question:- How we can send the Zoho creator email template using the send email by the workflow or using the Function? by the Workflow sendmail [ from: zoho.adminuserid to: "zohodeveloper@yopmail.com" subject: "Test Template" message: "Test
      • Upgraded to Zoho One but Zoho Meeting still says Free Plan

        I signed-up for the Zoho One plan. When exploring the applications included, I came across a problem with Zoho Meeting. It says it's the free plan. I emailed support but they sent me a link that doesn't work and, when I found the article on my own, it
      • 新年のご挨拶、直近のイベントスケジュール

        🎍🐍謹賀新年🎍🐍 ユーザーの皆さま、明けましておめでとうございます! コミュニティチームの中野です。 本年もよろしくお願い致します。 昨年のZoho Japanコミュニティでは、東京・大阪・名古屋・福岡 4都市でのユーザー交流会開催や、自社最大イベント「Zoholics Japan 2024」でZoho Championの皆さまとのパネルディスカッション、10月の東京ユーザー交流会では本社CRMプロダクトマネージャーを招きロードマップ解説セッションの実施、さらにZohoアンバサダープログラムのローンチ(近日公開予定)など、新たな取り組みに挑戦しました。
      • Directly Edit, Filter, and Sort Subforms on the Details Page

        Hello everyone, As you know, subforms allow you to associate multiple line items with a single record, greatly enhancing your data organization. For example, a sales order subform neatly lists all products, their quantities, amounts, and other relevant
      • Request to Customize Module Bar Placement in New Zoho CRM UI

        Hello Support and Zoho Community, I've been exploring the new UI of Zoho CRM "For Everyone" and have noticed a potential concern for my users. We are accustomed to having the module names displayed across the top, which made navigation more intuitive
      • Create workflow rules based on notes

        Last modified on 17/04/2023: Creating Workflow rules based on notes is now available for all Zoho CRM users in all DCs. Note that it was an early access feature available only upon request. As of April 13, 2023, it is rolled out for al Zoho CRM accounts.
      • Client script: Can not choose a date field for an onChange field event

        Hi Zoho Team Why can't I choose one of my date fields to trigger an onChange event? Is this a client script limitation, or something wrong with my instance? If it is a limitation, is this mentioned in the documentation anywhere? Thanks. Marcus
      • How to upload mass inventory quantity adjustment with batch number?

        I wanted to clean-up our inventory list; however, I have trouble performing the task as I don't know how to mass upload inventory adjustment with batch numbers. I don't want to do it manually as there are if not thousands at hundreds of inventory tr
      • [Important announcement] Zoho Writer will mandate DKIM configuration for automation users

        Hi all, Effective Dec. 31, 2024, configuring DKIM for From addresses will be mandatory to send emails via Zoho Writer. DKIM configuration allows recipient email servers to identify your emails as valid and not spam. Emails sent from domains without DKIM
      • Power BI connector (Zoho Creator) to Zoho Projects

        How can i connect power bi to Zoho Projects? domain is zoho.com How can i find workspace name, application link name and Report link name?
      • Upgrade User

        Hi Sir/Madame, I have 7 users in my organisation but I need upgrade more space only 2 users. Is it possibe? Thanks
      • Dashboard Auto-refresh

        Why is there no Auto-refresh on the Dashboard? People have been asking for the last 6 years for this function from what I can see in my reasearch, it seems like a very simple intergration for Zoho to achieve. on Sept. 2, 2014, this was added: Support
      • Console error with widget in View mode, not present in Edit Mode with ZOHO.CRM.API.updateRecord(config)

        hello i have that function to update an account records (from a widgets created with sigma) function handleCopyButtonCRMClick() { console.log('handleCopyButtonCRMClick'); /* * Fetch Information of Record passed in PageLoad * and insert the response into
      • add meeting link

        i want to add A meeting link in the mail when the user book the appointment then with the conformation mail i want to add meeting link there
      • Unable to add Guest Members

        We are having issues adding Guest Members to our Cliq account. We have sent out a number of request but it seems that only some people are able to access the platform. Others have received a message stating that they need to be granted access from an
      • CRM x WorkDrive: File storage for new CRM signups is now powered by WorkDrive

        Availability Editions: All DCs: All Release plan: Released for new signups in all DCs. It will be enabled for existing users in a phased manner in the upcoming months. Help documentation: Documents in Zoho CRM Manage folders in Documents tab Manage files
      • Next Page