g_modal - ShowFields with glide_list

mattburgess
Tera Expert

Hi,

 

Does anyone have any documentation on how this method works?

 

example

 

type: 'glide_list',
name: 'recipients',
label: getMessage('Get Recipients'),
reference: 'sys_user,
query: 'active=true',
referringTable: 'incident',
mandatory: true,
referringRecordId: g_form.getUniqueValue(),
value : g_form.getDisplayValue('assigned_to'),
displayValue: g_form.getDisplayValue('assigned_to')
dictionary: {
reference: 'sys_user'
}

 

My use case is to pop up a modal in Workspace from an incident record and at that point allow a user to click on glidelist field and search for any active user.

 

It always returns no records.

 

Anyone have any examples they have got working as well as any links to documentation for this method?

1 REPLY 1

Robert Szczygi1
Tera Contributor

Hi Matt,

I was looking for the same and was able to work this out based on existing code in ServiceNow platform.

You'd need to reference existing glide_list field, for example:

{
                type: 'glide_list',
                name: 'process_owner',  //existing 'glide_list' field on 'pwd_process' table
                label: 'CHOOSE YOUR LABEL',
                mandatory: true,
                referringTable: 'pwd_process', // 'process_owner' field exists on this table
                referringRecordId: '-1', // referring empty record
}
 
Query for the reference qualifier will be derived from Dictionary record of 'process_owner' field on 'pwd_process' table.
 
Let me know if this worked for you