Write ACL on child table based on parent table field doesn't work on Inline row insert

ShaidaC
Tera Guru

Hi Everyone, 
We have a requirement in a custom ServiceNow application where a logged-in user should be able to create and edit records on a child table only if their name is present in the Auditee field on the parent record.

I first configured a Create ACL on the child table, but it did not work as expected. I then added the condition to the Write ACL, and now the functionality works correctly when creating or editing records directly from the form view.

 When users try to create records using inline row insert from the related list, the record does not get created, even though the same users can create records successfully from the form.
Below are the configurations I have applied. Could someone help identify why inline insert from the related list is failing while form creation works?

Write ACL Script:

 

ShaidaC_0-1769622340281.png


This is what happens while user tries to save record after entering row values

ShaidaC_1-1769622420430.png

 

2 REPLIES 2

SumanthDosapati
Mega Sage

@ShaidaC 

Did you get any errors in browser console?

Check if this article helps you.

 

Regards,
Sumanth

Itallo Brandão
Tera Guru

Hi @ShaidaC ,

Technical Analysis: The issue lies in how ServiceNow initializes the current object during an Inline List Insert versus a Form Creation.

  • Form View (Working): When you click the New button on a related list, the system passes the parent's SysID via the URL (sysparm_query). The form loads with the audit_no field already populated in the current object. Your Write ACL runs, sees the value in audit_no, successfully dot-walks to .auditee, and returns true.

  • Inline List Insert (Failing): When you click "Insert a new row", the List Editor initializes a blank record object. At the specific moment the Write/Create ACL evaluates "Can this user write to this new row?", the link to the parent (audit_no) has not been established yet in the memory object.

    • Because current.audit_no is null (or empty) during this check, your script current.audit_no.auditee evaluates to undefined, causing the ACL to return false (or crash), blocking the save.

The Solution (Best Practice): Since you have a strict security requirement that depends on the parent record, you cannot use Inline List Insert for this table in this context. The List Editor does not reliably support parent-dependent security checks because the relationship is applied too late in the transaction.

You should disable Inline Insert for this specific Related List and force users to use the "New" button (which works perfectly).

Steps to Disable Inline Insert:

  1. Navigate to the Parent Form.

  2. Right-click the Related List header.

  3. Select Configure > List Control.

  4. Find the checkbox List edit insert row (you might need to add it to the form layout if it's hidden).

  5. Uncheck it (set it to false).

    • Alternative: You can also disable list editing entirely for this list by checking Omit Edit or using the Omit New / Omit Edit conditions if you want to restrict it further.

Summary: This is a known behavior of the List Editor. Since the ACL cannot "see" the parent during an inline insert, you must require users to use the Form view (New button) to ensure the security context is correctly loaded.

If this explanation helps you solve the issue, please mark it as Accepted Solution.

Best regards,
Brandão.