How to pass the variable value in redirect URL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 01:40 AM
Hello Everyone,
I have requirement when on select of "Learning" reference variable value which is one of the value of different table on current record producer it will redirect to another record producer which has same reference variable in redirect record producer which is working for me but I want populate default value "Learning" for the same reference variable in redirect record producer only in case of redirect another record producer.
I have attached screenshot Please look into those I have highlighted in screenshot where I'm expecting learning default value only at the time of redirect from another record producer.
OnChnage Catalog client script-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 05:17 AM
Hi @rmaroti
Sorry my bad, I missed a small thing over here.
OnChange script on first record producer
Please mark this as helpful and accept it as a solution if this works for you.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 09:49 PM
@_Gaurav it is redirecting perfect but not setting "Learning" value on another record producer.
OnChange Script on First RP-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 12:06 AM - edited 02-27-2024 12:08 AM
@rmaroti
In the second record producer, please make sure the backend value of "Learning" is "Learning". May be this could be the reason for not setting the value in the variable.
Also, try to add some delay in your onLoad CS
setTimeout(function(){
}, 5000);
//Here 5000 indicates 5sec of delay, you can make the change in the timing accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 02:59 AM
Hi @rmaroti
Please mark this as helpful and accept it as a solution if this works for you.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 03:55 AM
im using this one but not working my value_name is"Learning"
code is -
function getParameterValue(name) {
var url = top.location.href;
var value = new URLSearchParams(url).get(name);
if (value) {
return value;
}
if (!value) {
var gUrl = new GlideURL();
gUrl.setFromCurrent();
value = gUrl.getParam("sysparm_id");
return value;
}
}