Client Script - onBeforeUpdate, how to get the new value of picklist

Client Script - onBeforeUpdate, how to get the new value of picklist

Basically, I have "Contact Type" field, and if a particular type is selected from within Canvas detail page, I want it to show a popup warning. I have all of this working, except that getvalue on the particular field in question shows the currently saved value, not the new value selected by the user.

Here is the section that queries the field:

const field = ZDK.Page.getField("Contact_Type");
const newValue = field.getValue(); // Get the field value being set by the user

I am logging to console the output of this, and it shows that the value it's getting is not the one I'm selecting and trying to save, but the value that I am changing from
    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 コンテンツ




                              ご検討中の方