Function #10: Update item prices automatically based on the last transaction created

Function #10: Update item prices automatically based on the last transaction created

In businesses, item prices are not always fixed and can fluctuate due to various factors. If you find yourself manually adjusting the item rates every time they change, we have the ideal time-saving solution for you. In today's post, we bring you custom functions that automatically update an item's sales price and cost price based on the latest price entered during invoice and bill creation, respectively.

 

Prerequisites:


1. Create two Checkbox-type custom fields by the names "Update Selling Price" and "Update Cost Price" for the Items module. Depending on which checkbox is ticked, the corresponding custom function will be executed for the particular item.

 

2. You must also create a Connection named "zbooks" to successfully execute the function. You can watch the GIF attached below to know how to create the connection. 




Note: The custom functions will get executed for base currency transactions only.

Custom Function:

You will be setting up two Workflow rules associated with the corresponding custom function to update the selling price and cost price.

(I) Update selling price at item level based on the price entered during invoice creation

Navigate to Settings -> Automation -> Custom Functions -> +New Custom Function > Add the function code from this GitHub link.


Workflow Rule:

Go to Settings -> Automation -> Workflow Rules -> +New Workflow Rule and set up the workflow rule as shown below:-








In the final step of this workflow rule, associate the custom function you created and then hit Save.

 

(II) Update purchase price at item level based on the price entered during bill creation


Navigate to Settings -> Automation -> Custom Functions -> +New Custom Function > Add the function code from this
 GitHub link.

 

Workflow Rule:

 

Go to Settings -> Automation -> Workflow Rules -> +New Workflow Rule and set up the workflow rule as shown below:- 

In the final step of this workflow rule, associate the custom function you created and then hit Save.

 

You can now say goodbye to the tedious work involved with manually modifying the rates. With these custom functions, you can always be sure that your item prices are up-to-date as per the values entered in the last transaction.

We hope that you are benefitting from our custom function series. If you need any help with setting up the functions, connect with us at support@zohobooks.com.

 

Regards,
Shireen Farhana S
Zoho Books.


      • Recent Topics

      • Product sorting in Zoho Commerce - how can I influence standard behaviour?

        Hello Zoho, I want to sort my products by e.g. name, SKU (Ascending / Descending) or by another attribute. I could neither find any solution in the settings, nor an entry in this help. Can you advice how this would work? Seems the standard sorting is
      • Dynamically prefill ticket fields

        Hello, I am using Zoho Desk to collect tickets of our clients about orders they placed on our website. I would like to be able to prefill two tickets fields dynamically, in this case a readonly field for the order id, and a hidden field for the seller
      • Price Managment

        I have been in discussions with Zoho for some time and not getting what I need. Maybe someone can help explain the logic behind this for me as I fail to understand. When creating an item, you input a sales rate and purchase rate. These rates are just
      • Workflow Assistance in Zoho CRM

        Our client's sales team visits customers on-site and currently fills a physical paper form to capture customer details, and then separately re-enters the same data into Zoho CRM via the mobile app — resulting in double data entry. We want the salesperson
      • Delivery Note without services

        Hi all, It there a possibility to create a delivery note from an invoice without the listed services "idem type: service"? Thank you in advance, Michel
      • Automation Series: Auto-assign Task Followers

        As task progresses, several users are required to stay aware of the updates to plan their upcoming work items efficiently. Manually adding users as followers for an active task might create additional overhead. With this automation, followers can be added
      • Send Email Directly to Channel

        Hi, We are coming from Slack. In Slack each channel has a unique Email address that you can send emails too. I currently forward a specific type of email from my Gmail InBox directly do this channel for Verification Codes so my team doesn't have to ask
      • Terms & Conditions

        I have defined Terms & Conditions in the invoice setting and have set %TermsAndCondition% where I want it to appear but nothing shows up in that area. Is this something we have to define per invoice or can we have a global variable?
      • Billing Status Update

        Hello Latha, I’m working on a new automation (deluge) to fulfill one of our requirements. In this automation, there is a step to update the Work Order billing status from “Not Yet Invoiced” to “Non-Billable.” I tried to find the API information relevant
      • Export to pdf. Images not showing

        My report contains a column with images. When I export it as a list, the images do not show in the PDF document. I have published the report but the images are still not visible. What should I do so that the photos appear in the export?
      • Zoho CRM Kiosk question – Passing Screen Fields to a Function

        I am building a Kiosk in Zoho CRM to create new Supplier (Vendors) records. Current setup: Screen 1 contains user input fields: Supplier Name (Vendor_Name) First Name (First_Name) I created a Deluge function: createSupplier(vendor_name, first_name) The
      • パスワード

        ログインするためのパスワード取得したい。
      • Associate Zoho Project with Deal that is in a specific stage?

        Hi there, When a deal hits a certain stage, I'd like to associate it with an pre-exisiting zoho project? I am using blueprints. Using a custom function and deluge, how could I do this? I was thinking that the easiest option would be the modify the pre-made
      • [Product Update] Locations module migration in Zoho Books integration with Zoho Analytics

        Dear Customers, As Zoho Books are starting to support an advance version of the Branches/Warehouses module called the Locations module, users who choose to migrate to the Locations module in Zoho Books will also be migrated in Zoho Analytics-Zoho Books
      • New UI for Writer - Disappointed

        I've been enjoying Zoho Writer as a new user for about 6 months, and I really like it. One of my favorite things about it is the menu bar, which you can hide or leave out while still seeing most of your page because it is off to the left. I think this
      • Client Script Button in Related List become invalid

        Hi, I am the admin of our organization. And I setup a client script button in related list to raise payment refund request While this button become non selectable recently. I believe there is something wrong from zoho as this button had run for a year.
      • SMTP outgoing problem

        Hello I have a website where the SMTP email is connected through Zoho Mail SMTP. Today I am no longer receiving emails from the website. Joomla shows that the email was sent successfully, but I do not receive it.
      • Fiscal year setting

        Hi, I am looking into using Zoho Books. I cannot understand the organisation fiscal year setting. Our fiscal year runs from 1 April to 31 March. In the organisation profile, I need to set Fiscal Year to “April to March” and Start Date to “2” for the period
      • Issue with payments on invoices

        Hello, I’m having the following issue. When I create an invoice and try to apply a partial payment in a single transaction, the system does not allow it — it only allows full payment. Is this the expected behavior, or am I missing some configuration?
      • auto add as member the contact owner

        is there a way that i can make a zoho flow that will add the owner of the contact as a member of the chat after the round robin assignment?
      • Welcome to Zoho CommunitySpaces

        Hello everyone, This is your space to ask questions, share ideas, and connect with others building and growing their own communities. For those new here, Zoho CommunitySpaces is a platform for building and managing online communities—from discussion spaces
      • Updating Zoho Books UI when a field is changed

        I have this script to update Quotes Expiry date. estimateID = estimate.get("estimate_id"); numberDaysTobeExtended = 14; estimatedate = estimate.get("date").toDate(); organizationID = organization.get("organization_id"); estDate = estimate.get("date");
      • Announcing new features in Trident for Windows (v.1.20.4.0)

        Hello Community, Trident for Windows is here with some new features to elevate your work experience. Let's take a quick look at what's new. Export emails. You can now export emails in the .eml file format as compressed zipped files to create a secure
      • Announcing new features in Trident for Windows (v1.14.5.0)

        Hello Community, Trident for Windows is here with new features to elevate your workplace productivity. Let's take a quick look at what's new. Add and edit contacts Previously, you could view all of your personal and organizational contacts in Trident.
      • Announcing Trident desktop app for Zoho Mail & Zoho Workplace users

        Hello Community, I hope you are doing well and staying safe. As you know, our Mail & workplace teams have been constantly working on adding more value to our offerings to ensure you and your organization continue enjoying your Zoho experience. As part
      • Quick way to add a field in Chat Window

        I want to add Company Field in chat window to lessen the irrelevant users in sending chat and set them in mind that we are dealing with companies. I request that it will be as easy as possible like just ticking it then typing the label then connecting
      • Please Remove the Confirmation Popup

        Currently, every time a recruiter changes the status of a candidate in Zoho Recruit, a popup confirmation appears that requires clicking “OK, Got it” before proceeding. This creates unnecessary friction in the workflow, especially for users handling high
      • Team Module Issues?

        We are testing Team Licenses for use by our Customer Service staff. I created a Teamspace called CSR and only assigned two users to this space: Administrator (me) and “Team License Test.” Team License Test is assigned to the Team User profile, with a
      • Announcing new features in Trident for Windows (v.1.41.5.0)

        Hello Community! Trident for Windows just received an exciting update with new ways to collaborate and stay organized without leaving your workspace. Let’s take a look at what’s new! Integrate Zoho Meeting with Trident. You can now schedule, start, and
      • Zia Agent activation in Zoho Desk forces new Organization creation instead of deploying to existing one

        While attempting to complete the deployment and activation sequence of a new Zia Agent within our existing Zoho Desk environment, the activation process failed on the user interface, throwing a generic error (see print). However, despite the activation
      • Allow native Webhooks to authenticate via Connections

        Allow native Webhooks to authenticate via Connections (Basic Auth) instead of plaintext custom headers Summary Please allow native Webhooks (Workflow Rules > Instant Actions > Webhooks) to authenticate against the destination endpoint using the existing
      • How do page versions work these days?

        I thought that Zoho Wiki had the capability to display previous versions of a page, and optionally reinstate them. But I can't find a current doc on this subject -- is there one? From what I remember, that capability was accessed via the Version number
      • Ability to run report over 180 days

        Is there a reason Zoho limits the ability to run reports for records older than 180 days? In my view, the only reason I can think of is that it forces us to pay for Advanced Analytics (which I do).
      • Cloning a View

        When I clone a View, it doesn't make a copy; it only creates a new copy with the same default fields as if I were creating a new view. What is the purpose of cloning if it doesn't bring in the same fields? Thanks Rudy
      • New tickets with empty image contents

        Dear Support. From the end of last week onwards customers send messages for new tickets through microsoft graph (by email to support at procert.ch using the procert portal). We have an issue with the emails because well packed images are no longer visible.
      • Images not showing up in Desk tickets

        Customers are trying to send us screenshots to diagnose their issues. But Desk seems to be stopping the images/breaking the link when the ticket comes in. (We can see them in an email box getting cc'd on all tickets...so it's not our mail system). Help!
      • Introducing Databridge for Zoho Creator

        Hello, Enterprise Support Community! We'd like to highlight a recent utility that was released for Zoho Creator, that will allow you to connect external, private datasources with your Creator apps, Databridge. Databridge is an application that will need
      • Zoho HTML editor is removing MSO (Outlook) specific code.

        The ability to add in custom HTML is great. We are using MJML to generate our wonderfully cross platform and responsive email code that works on Act-On, Salesforce, Hubspot, Active Campaign, and lead liaison. The way it supports MSO (Outlook) is it included
      • Retail Payment Receipt

        Hi, So "payment receipts" have a "Retail" template for thermal printers, but the template is configured at A4 paper size!!! How is this retail guys? On the other hand, Invoices have 3 Retail templates which have 3 and 4 inch paper size, perfectly fitting
      • Custom Portal URL causing SAMEORIGIN error with embedded Page snippet

        In my app, I have a page that embeds another page. The URL that I have for the embedded page starts with https://creatorapp.zoho.com but the custom domain I have set up is https://kors.kerndell.com. Because the user logged into the app at https://kors.kerndell.com,
      • Next Page