"Add" UI action

JacobCassidy
Tera Contributor

Hello all,

 

I am trying to create an "add" ui action for a related list. When "add" is selected, it needs to open a list view of a custom table I created, in a separate tab. From there, the user needs to be able to select multiple records, select "add" or "save", the tab close automatically, and those records be populated in the related list. Any help?

6 REPLIES 6

@JacobCassidy 

you can check how OOTB "Add" button is created for related list.

On similar lines add for your table

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

Ravi Gaurav
Giga Sage

Hi @JacobCassidy 

  • UI Action on related list → open a modal / new tab with your custom table list.

     
    function openAddRecordsDialog() { var url = 'your_ui_page.do?sysparm_parent=' + g_form.getUniqueValue(); window.open(url, '_blank'); // or use GlideModal }
  • Custom UI Page/UI Builder → show records with checkboxes + Save button.

  • On Save → send selected sys_ids via GlideAjax/REST to a Script Include that inserts rows in the junction/child table:

     
    gr.initialize(); gr.parent = parentId; gr.child = childId; gr.insert();