The Zurich release has arrived! Interested in new features and functionalities? Click here for more

UI action that can associate current record to multiple records

cnshum
Tera Contributor

I have a custom table where I am trying to implement a UI action to open a list pop up that allows user to add records that are related to the current record. How do i implement something like this? (refer to the picture)

 

cnshum_0-1758256336742.png

 

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@cnshum 

you can see how the OOTB Add button is configured and do something similar for your table

SOLVED: Workaround for "Edit ..." buttons on Related Lists of Workspaces 

AnkurBawiskar_0-1758258032103.png

 

AnkurBawiskar_1-1758258066751.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

YaswanthKurre
Giga Guru

Hi @cnshum ,

 

You can create a UI Action that opens a pop-up window to add related records, you need to use a client-side script with GlideModal or GlideDialogWindow. This approach involves building a UI Page or using a simple list view, then passing the necessary information (like the current record's sys_id) to the pop-up.

 

You can take help of chatGPT or something to write code for you.

 

Mark this as helpful and correct if this answers your question.

 

Thanks,

Yaswanth

kaushal_snow
Mega Sage

Hi @cnshum ,

 

You can utilize the GlideDialogWindow API...just create a UI Action on your custom table, set its Client property to True, and define an onclick function that initializes a GlideDialogWindow. Within this dialog, you can embed a UI Page that displays a list of records from the related table, enabling users to select and associate them. Ensure to pass necessary parameters, such as the current record's sys_id, to the UI Page for context. Upon selection, use GlideAjax to communicate the selected records back to the parent form and establish the associations.....

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/