Function #51: Transaction Level Profitability for Quotes
![](https://desk.zoho.com:443/support/ImageDisplay?downloadType=uploadedFile&fileName=1714750749777.png&blockId=edbsne83c9a7e8ec28460a81f5b634ff2133bcb4dc4458f4158a91c7b0897e3d890fc&zgId=edbsn7709df772cce2825696f51e4f4f5fe02&mode=view)
Hello everyone, and welcome back to our series!
In a previous post, we shared a
custom function that could determine the profitability of a Sales Order. Today, we are presenting a similar function that calculates the profitability of a Quote.
The setup process remains the same. You will need to create a custom field and configure Workflow rules, but this time it will be for the Quotes module.
Prerequisites: 1. Create a custom field named
"Total Margin" for Quotes where the profit margin will be displayed.
![](https://desk.zoho.com:443/support/ImageDisplay?downloadType=uploadedFile&fileName=1714751733649.png&blockId=edbsne83c9a7e8ec28460a81f5b634ff2133b61c7a172e70fcb018d4b33394a3ef7d4&zgId=edbsn7709df772cce2825696f51e4f4f5fe02&mode=view)
2. Create a
Connection named
"zbooks" to successfully execute the scheduler. You can watch the GIF attached below to know how to create the connection.
![](https://desk.zoho.com:443/support/ImageDisplay?downloadType=uploadedFile&fileName=1714751759584.gif&blockId=edbsnbcbfd74f6123717b893a784369f3430d04b2fbf4d0b3fcfb14a715a3dfd28e6a&zgId=edbsn7709df772cce2825696f51e4f4f5fe02&mode=view)
Note: The cost price to calculate the margin will not be fetched and updated based on FIFO. The margin will be calculated based on the sales price entered in the transaction and the cost price mentioned at the item level. Also, the margin will be updated only after the quote is created.
Custom Function:
Navigate to Settings -> Automation -> Workflow Actions -> Custom Functions -> +New Custom Function -> Add the code from this
Github link -> Save.
Workflow Rule:
Go to Settings -> Automation -> Workflow Rules -> +New Workflow Rule and set up the workflow rule as shown below:-
![](https://desk.zoho.com:443/support/ImageDisplay?downloadType=uploadedFile&fileName=1714751842410.png&blockId=edbsnb6950b2f246abb789f058b203da40bb235dec4b328a2faeef071b35a36a3a53f&zgId=edbsn7709df772cce2825696f51e4f4f5fe02&mode=view)
![](https://desk.zoho.com:443/support/ImageDisplay?downloadType=uploadedFile&fileName=1714751853420.png&blockId=edbsnbcbfd74f6123717b893a784369f3430dfd47db00e4a892b0639608cc3b6b481c&zgId=edbsn7709df772cce2825696f51e4f4f5fe02&mode=view)
In the final step of this workflow rule, associate the custom function you created and then hit Save.
Try out this function and let us know your feedback in the comments. If you need any help with setting up the function, feel free to contact our support team at support[at]zohobooks[dot]com. We're here to assist you every step of the way.
Regards,
Shireen Farhana
Zoho Books
Zoho Developer Community
Deliver unforgettable customer experiences
Deliver unforgettable customer experiences
New to Zoho Marketing Plus?
Everything you need to run your marketing
New to Zoho Marketing Plus?
Everything you need to run your marketing
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
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
Zoho Show Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.