Providing access to the Edit button on the related list

Akshay Nayak
Tera Contributor

Hello All, 

I have issue with the Edit button visibility. I have a custom table ( lets say tb1). and a field on the Cmdb_ci_business_app table that is referred to this table tb1. On the tb1 form I have a related list which shows the related business application records. The business application table is restricted to be editable by only 2 groups, The restriction is put in via an ACL script(role requirement is just snc_internal)

if(gs.getUser().isMemberOf('group_1) || gs.getUser().isMemberOf('group_2)){

answer = true;

}

else

answer = false;

Now I want to provide the access to edit button on the related list on the tb1 form for a certain user field on the tb1 (delegate).  adding an or condition to the same ACL script is not working and the edit button is not showing up, 

I have checked and the acl works and members of the group_1 and group_2 can see the edit button. The omit edit button also has a script which is again checking for the same groups for restricting the edit button visibility. 

or condition added to the ACL script:  || current.tb1_field.u_delegate == gs.getUserID()

or condition added to the omit edit button : || parent.u_delegate == gs.getUserID()

 

Still the Edit button is not visible to the users in the field but not in one of those 2 groups.

 

What else can be put in to restrict the visibility that I need to check other than ACL and list control, or what is missing from the script in acl or in list control which is causing the edit button to be hidden.

3 REPLIES 3

Tai Vu
Kilo Patron
Kilo Patron

Hi @Akshay Nayak 

Let's double-check the Reference Floats in Dictionary, and also some other potential causes below.

Symptoms

  • The New button does not display on a related list
  • The Edit button does not display on a related list
  • A specific user or users in certain groups cannot see the Edit or New button on a related list

Cause

  • List Control settings are restricting visibility to the Edit button
  • Users do not have create or write access to either the child table or the field in the child table that references the parent table
  • The field on the child table that references the parent table is not configured as Reference Floats
  • The first record in the related list does not have create or write access to the child table or the field in the child table that references the parent table
  • The UI Action is restricting visibility to the button

For resolution, let look into this article.

Ref: KB0522170 The New or Edit button does not appear on a one-to-many related list

 

Cheers,

Tai Vu

Brad Bowman
Kilo Patron
Kilo Patron

Since this is a custom table, you must have added a Relationship for the Related List.  The OOTB Edit button is not available on custom related lists due to an ACL sys_ui_list_control.omit_edit_button.  This is disabled out of the box because it doesn't work for custom relationships, so if this is a custom relationship (if you can uncheck Omit Edit, that means the ACL is modified in your environment and you should revert that) you'll need to create a new UI Action, and maybe you can get that to work.

Rajesh Chopade1
Mega Sage

hi @Akshay Nayak 

Your script might be evaluated in a context that doesn't allow access to the 'parent' field properly. Try simplifying the logic and logging the output of 'parent.u_delegate' and 'gs.getUserID()' to confirm they're returning expected values.

 

Check if there are any client scripts or UI policies that might be manipulating the form fields or hiding the Edit button.

 

Ensure that the list control for the related list isn't overriding the visibility of the edit button in other contexts. Sometimes list control settings are restrictive for specific user roles.

 

If you’ve updated the ACL, try clearing cache (cache.do) or testing in a new session to ensure your changes are reflected.

 

i hope my answer helps you to resolve your issue, if yes please mark my answer helpful and correct.

thank you

rajesh