- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2019 03:44 AM
Hi , I am creating a UI action to redirect to a record that is queried from another table.
1.var itemID = current.sys_id; >>>> sys_id of record in Catalog Item table
2.var ts = GlideRecord('sys_atf_test_suite'); >>>> gliderecord on suite table to find a record which has sys_id of catalog item
3.ts.addQuery('u_suite_id',itemID); >>> quering the table for item sys id in field Suite id
4.ts.query();
5.while(ts.next()){
6.action.setRedirectURL('sys_atf_test_suite.do?sys_id=' + current.sysid); } >>> as i want to redirect to that record found from quering.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2019 03:48 AM
updated code
var itemID = current.sys_id;
var ts = new GlideRecord('sys_atf_test_suite');
ts.get('u_suite_id',itemID);
action.setRedirectURL('sys_atf_test_suite.do?sys_id=' + ts.sys_id);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2019 03:47 AM
can you confirm , you want to redirect it to the glide record query ts.sys_id page ? if yes then use ts.sys_id
1.var itemID = current.sys_id; >>>> sys_id of record in Catalog Item table
2.var ts = new GlideRecord('sys_atf_test_suite'); >>>> gliderecord on suite table to find a record which has sys_id of catalog item
3.ts.addQuery('u_suite_id',itemID); >>> quering the table for item sys id in field Suite id
4.ts.query();
5.while(ts.next()){
6.action.setRedirectURL('sys_atf_test_suite.do?sys_id=' + ts.sys_id); } >>> as i want to redirect to that record found from

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2019 03:48 AM
updated code
var itemID = current.sys_id;
var ts = new GlideRecord('sys_atf_test_suite');
ts.get('u_suite_id',itemID);
action.setRedirectURL('sys_atf_test_suite.do?sys_id=' + ts.sys_id);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2019 04:04 AM
Hi Harsh,
Thanks for the quick reply,
when i am clicking the button i am not redirecting to Suite Record , its going back to Item record

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2019 04:10 AM
can you add log here . let me know what are you getting in log
var itemID = current.sys_id;
var ts = new GlideRecord('sys_atf_test_suite');
ts.get('u_suite_id',itemID);
gs.log('sys id is '+ ts.sys_id);
action.setRedirectURL('sys_atf_test_suite.do?sys_id=' + ts.sys_id);