Pass value from one form to another using URL params

Waru
Tera Contributor

Hi everyone ,

 

im trying to pass values from one form to another using a UI action in the context menu, but all of the related fields are not being populated only the strings , is there a way to do this ?

 

here is the code

 

var urlStart = '/rm_story.do?sysparm_stack=rm_story.do&sys_id=-1&sysparm_query=';
	var url = urlStart + 'u_related_requested_item=' + current.number
	+ '^description =' +  'ServiceNow Platform'

	action.setRedirectURL(url);

 

 

 

thanks a lot

1 ACCEPTED SOLUTION

I believe the Display vlaue for product table is number. Try passing number corresponding to the 'SerivceNow Platform' product and it should work.

View solution in original post

14 REPLIES 14

Anand Kumar P
Giga Patron
Giga Patron

Hi @Waru,

Use below script for your requirement

var urlStart = '/rm_story.do?sysparm_stack=rm_story.do&sys_id=-1&sysparm_query=';
var u_related_requested_item = current.number;
var description = 'ServiceNow Platform';
var url = urlStart + 'u_related_requested_item=' + u_related_requested_item + '^description=' + description;

action.setRedirectURL(url);

Please mark it as solution proposed and helpful if it serves your purpose.

Thanks,

Anand

Hi Anand ,

tried the code above but it still doesn't populate the field u_related_request which is a related field , but the description is being populated succesfully

If it is a Reference field try below

var urlStart = '/rm_story.do?sysparm_stack=rm_story.do&sys_id=-1&sysparm_query=';
	var url = urlStart + 'u_related_requested_item=' + current.sys_id
	+ '^description =' +  'ServiceNow Platform'

	action.setRedirectURL(url);

worked like a charm , how would i use this with other related fields that are not the sysid? for example i have a field called program which should i write directly a string to ?