- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2018 01:20 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2018 01:48 AM
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);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2018 01:43 AM
nope i am using jakarta
In the alert i give me "undefined"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2018 01:48 AM
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);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2018 01:50 AM
Where i have to add this line. I mean after which line i have to add?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2018 01:53 AM
Yup its working..
What this lines do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2018 01:57 AM
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"));