Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to show the warning message via catalog client script

ankit_sharma487
Kilo Guru

i have to show

         

Warning Message: if request=='Remove Access'
This will revoke all your access from the group and group associated   access rights
Click OK to continue or Cancel to stay on the page

i wrote

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

    if (isLoading || newValue == '') {

          return;

    }

var checkREMOVE=g_form.getValue('request_type');

  if(checkREMOVE=="remove")

    {

    g_form.addErrorMessage("okokok"); //here i have to show the message with oK and Cancel buttons

    }

  //Type appropriate comment here, and begin script below

   

}

1 ACCEPTED SOLUTION
6 REPLIES 6

Please ignore my previous responses, i just learnt I was wrong on addErrorMessage


Inactive_Us1474
Giga Guru

If you want to print the error message, use g_form.showFieldMsg('impact','Low impact not allowed with High priority','error');


Refer : GlideForm (g form) - ServiceNow Wiki



If you need with the ok and cancel button   window.confirm('Message here');



Hope this helps.