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.


      Zoho Developer Community








                                Zoho Desk Resources

                                • Desk Community Learning Series


                                • Digest


                                • Functions


                                • Meetups


                                • Kbase


                                • Resources


                                • Glossary


                                • Desk Marketplace


                                • MVP Corner


                                • Word of the Day



                                    Zoho Marketing Automation


                                            Manage your brands on social media



                                                  Zoho TeamInbox Resources

                                                    Zoho DataPrep Resources



                                                      Zoho CRM Plus Resources

                                                        Zoho Books Resources


                                                          Zoho Subscriptions Resources

                                                            Zoho Projects Resources


                                                              Zoho Sprints Resources


                                                                Qntrl Resources


                                                                  Zoho Creator Resources


                                                                    Zoho WorkDrive Resources



                                                                      Zoho Campaigns Resources

                                                                        Zoho CRM Resources

                                                                        • CRM Community Learning Series

                                                                          CRM Community Learning Series


                                                                        • Tips

                                                                          Tips

                                                                        • Functions

                                                                          Functions

                                                                        • Meetups

                                                                          Meetups

                                                                        • Kbase

                                                                          Kbase

                                                                        • Resources

                                                                          Resources

                                                                        • Digest

                                                                          Digest

                                                                        • CRM Marketplace

                                                                          CRM Marketplace

                                                                        • MVP Corner

                                                                          MVP Corner







                                                                            Design. Discuss. Deliver.

                                                                            Create visually engaging stories with Zoho Show.

                                                                            Get Started Now