Hiding the Attachments user now member of current assignment group.

yadi
Tera Contributor

Hi,

 

I am trying to achieve a requirement where i want to hide all attachments attached in the form if the the current logged in user is not member of current assignment group. i tried this through ACL but no luck.

NOTE: i trying to achieve this on scoped app.

 

Regards

Yadvinder

7 REPLIES 7

Hi Ankur,

 

OnLoad Client script:

  if (g_scratchpad.userInGroup.toString() == 'false') {
        // Hide the attachments section
        var attachmentSection = document.getElementById('header_attachment');
        if (attachmentSection) {
            attachmentSection.style.display = 'none';
        }
    }
 
BR:
g_scratchpad.userInGroup = gs.getUser().isMemberOf(current.assignment_group.toString());
 
Regards
Yadvinder

@yadi 

It should work provided you followed my this step

Also for your client script did you ensure Isolate Script Field = False

This field is not on form but from list make it False

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

How to hide from activity log as its showing in activity log.