Manage attachment button visibility

laszlobolya
Kilo Expert

Hello, I`m a bit lost may yu can help me?

We have a custom table, record producers create the data.

End user with no roles can use the record producer, add attachment to the form and submit it. Attachment then is visible on the ticket also.

We grant read role to the custom table with Access Control   script to end user current.opened_by == gs.getUserID() || current.caller_id == gs.getUserID() to make sure they can read only all the fields.

If attachement on the ticket end user can see Manage attachment text link, also download that.

The problem:
No Paper Click icon for end user and no "Add" option when they see the Manage attachment popup window.

I tried to grant rights with Access Control to sys_attachment table, even more to our custom table, but no success. Also client script did not help:

function onLoad() {

  g_form.enableAttachments()

}

So could you advise me how can I make sure on custom table, end user without role:

Can see the Paper clip icon
Can add attachments?

Many thanks!

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Laszlo,



The paper clip icon will be shown only when user has write access to your table. Also the Add button will be shown if user has write access to the table


Try to create a write acl on table and give end user's role to the acl and try opening the record again.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


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

View solution in original post

5 REPLIES 5

laszlobolya
Kilo Expert

Yeah, thanks for the confirmation! I


I was using wrong script on ACL.



Here is a good one:


Write on custom table
empty roles row



Script:


current.requested_for == gs.getUserID() || current.opened_by == gs.getUserID() || current.watch_list.indexOf(gs.getUserID()) > -1;



With that user without roles can add attachment to that record. Though also now the other fields are editable, but I hope I can manage those with more ACL