- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2018 03:54 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2018 09:37 PM
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());
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2018 04:10 AM
You can make use of script provided inside the Record producer to set Value of urgency. Make use of current and producer object to set value in incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2018 04:12 AM
Actually I already have one more variable which is a reference variable, and caller_id is the name of that variable only.
Also, if I use the script present in the Record Producer, then I won't be able to show the value on the Record Producer. And, I've to show the value of the variables onLoad.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2018 04:16 AM
Is the caller_id field populated onLoad?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2018 04:19 AM
Yes, its default value is the current user name. I've written this code in the default value section of the variable:- javascript:gs.getUserName()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2018 04:21 AM
the script i provided above should work to get the fields from the caller_id field then. can you post a screenshot of the onLoad client script please?