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.
Here's how it works:
Zylker Stationery has launched several promotional offers to boost sales during the back-to-school season. One of these offers is "Buy 6 Brushes, Get a Palette for Free." To implement this in Zoho Books, the first step is to designate the Palette as the free item associated with the purchase of Brushes in the Lookup custom field. The "freeItemQTY" node in the script should be set to 6.
When creating an invoice, the user must tick the checkbox custom field to apply the promotion, add the items, and save the invoice as a draft. Subsequently, the custom function will get executed, automatically adding the Palette as a separate line item priced at zero. The updated invoice will then be sent to the selected customers.
If you’ve been running promotions like this and adding the free items manually every time you create an invoice, this function will really help save you time and effort! Give it a try and let us know how it goes. Additionally, we previously shared another function that automatically adds free items based on the invoice amount—be sure to check it out [
here]. If you have any other use cases you'd like to automate in Zoho Books, drop an email to
support[at]zohobooks[dot]com, and we can explore the possibilities.
Regards,
Shireen Farhana
Zoho Books