By using a Catalog Client Script, the Record Producer is not submitting

Sagar Manocha
Tera Contributor

Hi,

I've written a Catalog client script for a Record Producer but when i am using the script, the Record is not submitting.

Below is the code present that i am using:-

function onLoad(){
//Type appropriate comment here, and begin script below
g_form.getReference('caller_id', somefun);
var status;
function somefun(req){
if(req.vip=='true'){
g_form.addInfoMessage("inside if");
//g_form.setValue('urgency',6);
//g_form.setReadOnly('urgency',true);
}
else{
g_form.removeOption('urgency',6);
}
}
}

Regarding the two lines of code which are commented right now, if I am removing the comments from any one the line, the Record Producer is not working. Below is the screenshot of the Record Producer after clicking the submit button.

find_real_file.png

1 ACCEPTED SOLUTION

Shweta KHAJAPUR
Tera Guru

Hi Sagar,

Below code worked for me,

function onLoad() {

var caller = g_form.getReference('caller_id', doAlert);

}
function doAlert(caller) {
if (caller.vip == 'true'){
var x = 2;
g_form.setValue('urgency',x.toString());
}else{
var y = 6;
g_form.setValue('urgency',y.toString());
}

}

View solution in original post

22 REPLIES 22

Omkar Mone
Mega Sage

Hi 

Try using onSubmit() client script once or use Script include instead of getRefernce.

Shweta KHAJAPUR
Tera Guru

Hi Sagar,

Below code worked for me,

function onLoad() {

var caller = g_form.getReference('caller_id', doAlert);

}
function doAlert(caller) {
if (caller.vip == 'true'){
var x = 2;
g_form.setValue('urgency',x.toString());
}else{
var y = 6;
g_form.setValue('urgency',y.toString());
}

}

Hi Shweta,

The above code is working for me as well. Thank you so much for your help.