Populated Requested for from call module

kun1
Tera Expert
 

Hi Team,

We have a new call in which we have caller field (back end name :caller).So, when we set the call type as request it redirect it to a sc_cat_item view.

NEW CALL:-

After submitting the for, the view is like this:-

So here is the issue is In the caller form i set the caller as A (log in in service now from B), and when it redirect to catalog item view, In the requested for, it set the vale B(Log-in from B). So, please help me here.

 

 

1 ACCEPTED SOLUTION

Just try these lines in your onLoad client script and see if it works

function onLoad(){
var gUrl = new GlideURL();
gUrl.setFromCurrent();
var user = decodeURI(gUrl.getParam("sysparm_requested_for"));
alert(user);
g_form.setValue('reqFor', user);
}

View solution in original post

16 REPLIES 16

nope i am using jakarta

 

In the alert i give me "undefined"

Just try these lines in your onLoad client script and see if it works

function onLoad(){
var gUrl = new GlideURL();
gUrl.setFromCurrent();
var user = decodeURI(gUrl.getParam("sysparm_requested_for"));
alert(user);
g_form.setValue('reqFor', user);
}

Where i have to add this line. I mean after which line i have to add?

Yup its working..

What this lines do?

It is just an alternate way to fetch the parameters from URL using the GlideURL function. You can apply the same logic on other parameters as well.

var user = decodeURI(gUrl.getParam("sysparm_requested_for"));