- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 01:42 AM - edited 09-18-2023 01:46 AM
This code is written in workspace client script section of a UI action. This work fine but opens only 1 tab. I want to open 3 tabs.
for (var i=0; i<3; i++) {
var user_query = '^first_name=Anthony';
g_aw.openRecord("sys_user", "-1", {"query": user_query }); // -1 because it is a new record and no sys id
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2025 03:57 AM
I was finally able to get this to work and open mulitple tabs. Prior to doing so it would open the last tab.
I had to implement the timeout and call it from the loop instead of nesting it in the loop. It should have worked just fine the way @Ratnakar7 has it outlined but it didnt.
I had to adjust to
for (var i =0; i<answer.length; i++){
timeMe(answer[i].table, answer[i].sys_id)
}
function timeMe(table,sysid){
setTimeout(function(){
g_aw.openRecord(table,sysid);
},1000);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2025 03:57 AM
I was finally able to get this to work and open mulitple tabs. Prior to doing so it would open the last tab.
I had to implement the timeout and call it from the loop instead of nesting it in the loop. It should have worked just fine the way @Ratnakar7 has it outlined but it didnt.
I had to adjust to
for (var i =0; i<answer.length; i++){
timeMe(answer[i].table, answer[i].sys_id)
}
function timeMe(table,sysid){
setTimeout(function(){
g_aw.openRecord(table,sysid);
},1000);
}