Client script alert message based on catalog variable field

daniellethomson
Tera Expert

I have a request to create an alert message off a yes/no field for a service catalog item. Below is the script but it's not creating the alert. I'm very green in scripting- could someone look at it? Thanks!!

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

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

          return;

    }

var chk = g_form.getValue('background_check');

  if (chk == 'No')

  {

  alert(getMessage("You must submit the background check to Vendor Management befoe proceeding"));

  }

}

6 REPLIES 6

Not a problem. I've missed that myself.


keshavgowda
Tera Contributor

Hi @daniellethomson ,

 

Check for "UI type" on Catalogue client script, if you are on service portal for ordering the item then set the value of UI type to Mobile/Service Portal.