Block Button/Process for Group of Users

Hi All,

I thought I had this all solved and resolved but apparently not. Essentially I am on the look out for the best method to prevent a group of users from checking a check box and savings.

For this instance it’s the Closed tick box for the Job Completion/Closing Maintenance as below;

Originally I created a Method BPM on the JobClosing.OnChangeJobClosed directive as a Pre-Process.

It worked fairly simply, if the user was apart of a group, set the field back to false and raise an exception.

Now, the exception did pop up for the user, however, the check box was still ticked and would still process to complete the job.

I’ve tried processes on JobEntry but have had no luck. I’m running out of ideas and cannot seem to figure out the cleanest way of making this possible. This would be really good to understand properly for future use as well.

Any help would be great thanks!

1 Like

I think you could use the method from this post Check user group in App Studio - Tech Demo If the condition is true, do a property set on that checkbox to make it disabled.

5 Likes

Your BPM should work, but I would try it against JobClosing.CloseJob.

This is what I have in place.

And I didn’t do any sort of Set Field. Raising an exception will prevent any changes they attempt to make when they click the Close checkbox so both Complete & Close revert back to false automatically.

2 Likes

Hi David,

Thank you for the solution, this worked perfectly. Guess I was over complicating it by thinking it needed to go before the CloseJob function.

1 Like

This is interesting, I will definitely implement this into our Pilot environment and test it out.

Service Security Maintenance is another way to restrict Business object usage per security group, without using BPM. Worth taking a look, to add to your developer toolkit

1 Like

So it turns out the users of the group actually need access to ‘Complete’ the Jobs but not ‘Closed’, so this has become tricky. As the method on JobClosing.Close affects the Complete checkbox, so I don’t believe I can use this method.

I tried Field Security but that did nothing for the menu so seem to be back where I was originally. :melting_face:

Agree here - the BPM thing is fine if it works, but I mean keep it simple and just lock out the box(es) from the get-go. This should work around your issue @GE-Chess

1 Like

Crap, yeah, the JobClose method controls Completion and Closing, but you can get around that very easily…

Just add another (first) condition to check if the JobClosing.JobClosed = true.

If the Job Closed checkbox is true (they’re trying to close the job)… THEN make sure they have the right privileges… if not, FAIL.

If they only click the Complete checkbox… and JobClosing.JobClosed = false… then the method runs successfully and only completes the job.

2 Likes

Separate from David’s excellent answer, I like to remind folks that you CAN change the text on the widgets!

It sure makes finding things easier until we can search source code in a repository…

3 Likes

Here you go @Mark_Wonsil, I fixed mine.

6 Likes

Ahh I did try this sort of method but I think my Condition for checking if JobClosing.JobClosed = true wasn’t working correctly,

Now implemented this and it now works the way they want it. Thanks again for your help!

1 Like