Client Script help for setting a listener
Hello Zoho Community,
I need assistance with modifying my current client script.
Current Setup
- I have a client script on the Quote module within CRM, which is set to run on the Edit Page.
- The script is triggered by a Field Event on a checkbox field called Update Service Fee.
- When this checkbox is checked, the script calculates 18% of the Sub Total value and displays it in the New Service Fee field.
Issue
- The script functions correctly when the checkbox is checked.
- However, I would prefer that the New Service Fee value updates automatically whenever the Sub Total value changes, without needing to check the Update Service Fee box each time.
Attempted Solutions
- I’ve tried several JavaScript listeners to detect changes in the Sub Total field, but none have worked as expected.
Current Script
Here’s the basic script I’m currently using:
var total = ZDK.Page.getField('Sub_Total').getValue();
var sub = ZDK.Page.getField("New_Service_Fee").getValue();
var service_fee = total * 0.18;
ZDK.Page.getField("New_Service_Fee").setValue(service_fee);
Request
Could you please guide me on how to modify the script so that the New Service Fee field updates automatically every time the Sub Total field changes?
Thank you for your help.
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Zoho Orchestly Resources
Zoho Creator Resources
Zoho WorkDrive Resources
Zoho Campaigns Resources
Zoho CRM Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.