cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
annathompson
Nintex Newbie

Disable delete button in attachments control

Jump to solution

Is it possible to disable/hide the delete button in the attachments control for a group of users? They still need the ability to add and open attachments. I can only disable the whole attachments control using a rule. Thanks

Labels: (1)
Tags (1)
0 Kudos
Reply
5 Replies
Automation Master
Automation Master

Re: Disable delete button in attachments control

Jump to solution

there is no direct possibility, you will have to write a javascript code to achieve that.

following document might point you to right direction  

View solution in original post

Reply
praios81
Nintex Newbie

Re: Disable delete button in attachments control

Jump to solution

Hi Anna,

Marians link is correct. Another way do hide the delete Link would be by using css in the custom css section of the form settings but it would affect all users instead of users of a single group.

.nf-attachmentsTable tr td.ms-propertysheet,
.nf-attachmentsTable tr td.propertysheet
{display:none}

Reply
ctarr
Nintex Newbie

Re: Disable delete button in attachments control

Jump to solution

I would suggest the use of both approaches, use javascript to assess if a user is in a group and then using CSS disable / hide the delete button using the CSS above. You can use a function like the following, replacing Groupname with your group name for the users:

function CheckUserGroup(){
  var data = NWF$.ajax({
    url: "../_api/web/currentuser/groups?$select=Title&$filter=Title eq 'GROUPNAME'",
    method: "GET",
    async: false,
    headers: { "Accept": "application/json; odata=verbose" },
    success: function (data) {
          $.each(data.d.results, function(i,result) {
              $(".nf-attachmentsTable tr td.ms-propertysheet").css("display","none");

              $(".nf-attachmentsTable tr td.propertysheet").css("display","none");
      });
    },
        error: function (data) {
            alert('No Group Found');
        }
  });
}

Reply
annathompson
Nintex Newbie

Re: Disable delete button in attachments control

Jump to solution

Thank you for providing the function. I've added it to my form. When I try the form in preview mode it hides the delete attachment button. However when I publish the form and try it from the list it doesn't hide the delete button. Perhaps I am missing something?

0 Kudos
Reply
sudhirkumarchow
Nintex Newbie

Re: Disable delete button in attachments control

Jump to solution

@ctarr It worked pertectly, Than You

0 Kudos
Reply