We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Issue with Zurich Version

Sathwik1
Tera Expert

Below onChange Client script is working in yokohoma but not in zurich, can someone please help me to understand on what is the issue?

 

function onChange(control, oldValue, newValue, isLoading) {

    if (isLoading || !newValue)
        return;

    var proceed = confirm("Please confirm");

    if (!proceed) {

        var ga = new GlideAjax('ScriptIncludeName');
        ga.addParam('sysparm_name', 'Function');
        ga.addParam('sysparm_abc', g_form.getValue('fieldname'));
        ga.getXML(function() {
            g_form.setValue('fieldname', '');
            g_form.reload();
            g_form.showFieldMsg(fieldname, 'cleared.', 'error');
        });
    }
}

 

@Ankur Bawiskar  @Its_Sagnic @Matthew_13 

19 REPLIES 19

Dr Atul G- LNG
Tera Patron

What you are trying to achieve mate. Give more details.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Alert/confirm popup is not coming ..

 

This confirm popup used to come in Yokohama .. when we upgrade instance to Zurich pop-up is not coming...

 

So is there any property or anything we need to add to show popup

GlideFather
Tera Patron

Hi @Sathwik1,

 

not working how? :)) add there g_form.addInfoMessage('some text here'); to know if it is triggered.

 

Please share some more details

_____
100 % GlideFather experience and 0 % generative AI

not working, but the same script has been there in the other instance which is in yokohoma,, there it is wroking fine.

here onchange was written on attachment type field. @GlideFather 

Tanushree Maiti
Giga Sage

Hi @Sathwik1 ,

 

Can you go through this link and check if replacing reload()  making your code working.

 

https://www.servicenow.com/community/developer-forum/reload-form-on-client-script/td-p/1886057/page/...

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: