Home General Discussion

Cireson Portal

Dear All,

I would like to disable the viewing of attachments section at the top of a ticket for certain technicians, the paper clip. Do you have any code for this?

Thanks

Daniel

Best Answer

Answers

  • Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭

    Something like this should do it:

    app.custom.formTasks.add('Incident', null, function (formObj, viewModel) {
      formObj.boundReady(function () {
        // Hide attachment btn for usernames in the list
        let disableAttachementsFor = ['User1','User2'];    
        if(disableAttachementsFor.includes(session.user.UserName)) {
          $('#headerAttachmentBtn').hide();
        }
      });
    
      return;
    });
    
  • CaterhamITSupportCaterhamITSupport Member IT Monkey ✭

    I tried the above code but it didn't work.

    Thanks

    Daniel

  • Mikkel_MadsenMikkel_Madsen Customer Advanced IT Monkey ✭✭✭

    @CaterhamITSupport

    Just put the line in the code you use for hidden the other buttons

    //hides attachment button/paperclips
    $("#headerAttachmentBtn").hide();
    
    
  • Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭

    Hm, try wrapping the hide in a 0-timeout, maybe the timing is a little off: setTimeout( function(){ $('#headerAttachmentBtn').hide(); }, 0);

  • CaterhamITSupportCaterhamITSupport Member IT Monkey ✭

    Dear Mikkel,

    I tried:

    //hides attachment button/paperclips
    $("#headerAttachmentBtn").hide();
    

    But it didn't seem to work? I maybe doing something wrong?

    Daniel

  • CaterhamITSupportCaterhamITSupport Member IT Monkey ✭

    That worked really well.

    Thank you.

    Daniel

Sign In or Register to comment.