How to open multiple sub tabs from a loop through workspace client script of a UI action ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 05:13 AM - edited 09-20-2023 05:17 AM
I want to open multiple sub tabs dynamically from workspace client script of a UI action which is client callable.
function onClick(g_form) {
var users = ["Mike", "John", "Albert"]; // this will be replaced with list type field from the form
for (var i = 0; i < users.length; i++) {
var user_query = '^first_name=' + users[i];
g_aw.openRecord("sys_user", "-1", { "query": user_query });
}
}
Current result - one sub tab opens and auto fills first name field with the last item 'Albert' on user form
Expected result - 3 sub tabs to open as total users are 3. each subtab will have first name field populated on the subtab on user form.
ex- One sub tab will have Mike auto filled under first name on user table, 2nd sub tab will will have John auto filled under first name on user table, 3rd sub tab will will have Albert auto filled under first name on user table