UI Action that allows user to select an assignment group and an assigned _to user in that group

NourT
Tera Contributor

Hello, I have created a UI action workspace form button that when clicked shows a pop-up with the assignment group and assigned to fields. 

 

the first field correctly displays all group options in the sys_user_group table,

however, the "assign to" field is not displaying any users from the sys_user table, let alone those in the group selected above.

 

the pop-up will be used to assign both the group and a member in that selected group, all in the same pop-up, any solutions/suggestions are appreciated.

 

NourT_0-1776065481145.png

 

here is the workspace client script fyr:

 

var fields = [{
        type: 'reference',
        name: 'assignment_group',
        label: 'Assignment Group',
        reference: 'sys_user_group',
        mandatory: true,
       // this line was for testing purposes query: 'sys_id = e92db6cca8100f1c60f7a51d53ae009c',
 
        referringTable: g_form.getTableName(),
        referringRecordId: g_form.getUniqueValue(),
 
    },
{
        type: 'reference',
        name: 'assigned_to',
        label: 'Assign to',
        reference: 'sys_user',
        mandatory: true,
 
        referringTable: g_form.getTableName(),
        referringRecordId: g_form.getUniqueValue(),
 
    },
 
];
 
g_modal.showFields({
    title: "Select a user",
    fields: fields,
    size: 'lg'
}).then(function(fieldValues) {
    g_form.setValue('assignment_group', fieldValues.updatedFields[0].value);
    g_form.setValue('assigned_to', fieldValues.updatedFields[1].value);
    g_form.save();
});
1 REPLY 1

lpruit2
Mega Sage

Greetings @NourT. Apologies for answering your question with a question but what is the business value or purpose of having the UI Action to gain access to the Assignment Group and Assigned To fields? Are those fields not currently accessible on the existing form for some reason? If so, wouldn't it be easier to interact with those fields directly on the form?