You are viewing limited content. For full access, please sign in.

Question

Question

Restrict action buttons per user

asked on February 14, 2018

Hi All,

 

Have a client using Laserfiche forms to generate Work orders, and they have requested their supervisors to be able to progress the form if required (e.g. The supervisor should be able to "complete" an active job once it has been finished)

The client does not want the supervisors to have the ability to "cancel" and active work order. 


Essentially an active work order has 3 action buttons.

  • Complete
  • Reassign
  • Cancel 

 

Is there a way we can restrict or hide action buttons per users / teams? 

Another option I thought of was to have "Cancelled" jobs to route to the admin team for them to "Approve" the cancellation, however, the client would prefer the first option if possible.

 

Thanks!

0 0

Replies

replied on February 15, 2018

you could do it by using javascript to hide the button base on the users login to the forms

1 0
replied on February 15, 2018

Hi Rene,

 

I was hoping this would be possible, would you happen to have an example of how to achieve this?

0 0
replied on February 16, 2018 Show version history

There is a token for currently logged in user available for forms. If you pull this back into a hidden field (just add a new single line and hide it)  and use a Javascript if statement to hide / show buttons based on that variable value. 

1 0
replied on February 16, 2018

here a sample c# code that do almost what you want, you will just need to tweek it with proper parameters

$(document).ready(function () {
   
    $('.Submit').attr('disabled', 'disabled');
	//$('.Submit,.Reject,.Approve').hide();
	
    $('#q125 input').click(function () {
        setTimeout(function () {
            if ($('#q10 input').val() > "0") {
               
                $('.Submit').removeAttr('disabled');
				//$('.Submit,.Reject,.Approve').show();
                            
            } else {
               
                $('.Submit').attr('disabled', 'disabled');
				//$('.Submit,.Reject,.Approve').hide();
            }
        }, 300);
    });
});

 

0 0
replied on February 15, 2018

You could uncheck the buttons that you don't want to appear for a particular task. If you need the same form to have the buttons for another user, then just duplicate the user task and adjust the action buttons accordingly.

actionButtons.png
0 0
replied on February 15, 2018

Hi Raul,

 

Would this mean that both admin and the supervisor would both have to "Complete" the task as they would be separate tasks?

0 0
replied on February 15, 2018

That's correct. 

If what you are looking for is to have only one user task where either person can log in and complete the form, but show the buttons depending on the user, then Rene's suggestion is more suitable.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.