M2M Record Created with Empty Reference Fields When Using Add Button in Related List
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi Everyone,
I am facing an issue while adding records to an M2M table through the Add button on a related list.
When a user clicks the Add button and selects a record, an M2M record is successfully created in the backend. However, the reference fields are getting inserted as empty, and the mapping is not visible in the related list after refreshing the form.
I have checked the Create ACL on the M2M table, and the user belongs to the required group and has permission to create records. I also checked for Business Rules, but there are no Before Insert Business Rules on the M2M table.
Interestingly, when performing the same operation as an Admin, the records are added successfully with both reference fields populated.
Could someone please suggest what else I should investigate to identify the root cause?
Any suggestions or guidance would be greatly appreciated.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
22m ago
Hi @harinya,
Since the same action works as admin, the restriction is role-based. Field-level ACLs are the most likely cause. The table-level create ACL passes, so the record gets inserted, but if the user fails the create/write ACL on the reference fields, those values are silently dropped.
What to check:
- Field-level ACLs. Look at create and write ACLs on m2m_table.<ref_field> and m2m_table.*. If there’s no field-level create ACL, the field’s write ACL applies. Also check whether “Admin overrides” is ticked, because that explains why admin works.
- Debug Security Rules. Impersonate the user, go to System Security > Debugging > Debug Security Rules, and repeat the Add. Any failed rule on the reference fields will be shown.
- If no ACL fails, check the other role-based restrictions admin also bypasses:
- Create/Write roles on the reference fields’ dictionary entries
- Query Business Rules on the referenced tables (these can hide the records in the related list)
- Read ACLs on the referenced tables and their Display field
Hope it works!