Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Removing "Insert a new row" on an embedded list

tahnalos
Kilo Sage

We have several embedded lists that we use for our forms and we are trying to ensure that the users do not have any ability to add list items to these embedded lists.  While we have removed the edit function, the more pressing issue is the ability to add a new entry on the embedded list as the "insert a new row" option is present.

 

Restricting the ability to add new based on a role is not working, and I was advised that the only way to do this is through an ACL which I do not mind, but the users in question who would be using this form do natively have permissions to create these records from scratch on their own.  We just want to restrict their ability to create from an embedded related list.  Can someone please provide me with some ideas on how to handle this?

1 REPLY 1

anamariatam
Tera Expert

Hi @tahnalos,

The "Insert a new row..." option is not tied to the New button or to roles. It is driven by the List edit insert row checkbox on the List Control, so an ACL isn't needed here, and you avoid touching the create permissions your users need elsewhere.

To remove it only from the embedded list:

  1. Open the form that contains the embedded list.
  2. Right-click the column header of the embedded list and go to Configure > List Control.
  3. Check that the List Control record shows the related list (the parent relationship) and not just the child table. That ensures the change applies only to this embedded list and not to the table's main list view or other related lists.
  4. Uncheck List edit insert row and save.
  5. Repeat for each embedded list where you want to remove it.

Since that List Control is specific to the embedded list relationship, users can still create these records from the standard form or module as they do today.

A couple of notes:

  • This checkbox can't be made conditional. If you ever need to show or hide the insert row based on the parent record (state, assigned user, etc.), that gets more complicated, and the "Omit New Condition" script only affects the New button, not the insert row.
  • If you also want to fully lock inline editing of the existing rows, you can add a list_edit ACL on the child table for the relevant fields (or *). That handles edits, but not the insert row, which is why the List Control setting is still the piece you need.

Hope this helps.

 

Sources: