why alert is not displaying in catalog client script?

Gamarawaji
Giga Contributor

Hi ,

 

when i try to give alert in catalog client script, it is not displaying anything.

please refer the code,

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var request1 = g_form.getValue('request');

if(request1 =='Complete a job in IWS')
{
alert('Job should be only in Error state');
}
//Type appropriate comment here, and begin script below

}

 

Thank You.

16 REPLIES 16

Anil Lande
Kilo Patron

Hi,

Please check the value used in choices and use it for comparison in if condition.

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var request1 = g_form.getValue('request');
alert(request1);  // check what value is set in backednd and use it in if condtion

if(request1 =='Complete a job in IWS')
{
alert('Job should be only in Error state');
}
//Type appropriate comment here, and begin script below

}

 

I have added one more alert in your script, it will help you to find actual value used in backend for your options/choices.

 

Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

for the first alert

alert(request1);  // check what value is set in backednd and use it in if condtion

it is showing on screen

How are you testing this?

-Anurag

by selecting request choice as complete a job in IWS