Client Script help for setting a listener

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


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      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

                        • 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




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方