When customizing an app, you may want to allow functionality to only those users with admin permissions.
There are two things you need to know in order to customize this:
If the permission is to be applied to a control on the screen, the event to trigger this check should be one of the screen events.
The admin user permission can be retrieved using the value from session called User - Has Admin Permissions.
Example: Disable a field on the Estimates screen
In the below example, we will customize the estimate screen to enable or disabled the wait for sync approval checkbox depending on whether or not the user logged in has admin permissions.
NOTE: This example will assume the basics of customization are known.
Customize the Estimate screen and create a copy of it.
All permission checks for showing or hiding fields is done in the Screen's Load event, so open that up.
At the bottom, add a conditional statement.
Set this conditional statement up to check if User - Has Admin Permissions (a value from session) is true.
For the If true part of the statement, add in an Enable / Disable Controls action.
For the Enable / Disable Controls action, enable the field
IsWaitingForSyncApproval
.For the Else part of the conditional statement, add in another Enable / Disable Controls action.
For this Enable / Disable Controls action, disable the field
IsWaitingForSyncApproval
.
Now, when you test this screen, you will find those without the Admin permissions will not be able to access this control.