- 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 04:10 AM
u_suite_id : this field is correct ? you created custom column on sys_atf_test_suite table ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2019 04:12 AM
No Worries, Harshwardhan it worked.
Thanks a ton for this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2019 04:12 AM
glad i helped. kindly mark my answer as correct and close this thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2019 02:29 AM
HI harshvardhan need a little more help. i need a condition as well on ui action that the button will only reflect if there is already an relation established for the item in suite table..
can this be done ?