Validating data entry based on user login

Quick Guide >>

Axpert provides the following global variables

– username

– userrole

These variables can be used in expressions. The result of this expression can be used to apply validations. For example to set a rule like ram can enter amounts less than 10000 only, you set a validation expression as below for the amount field in the tstruct

iif(username#{ram} | amount<10000, {T}, {Ram can enter amount only less than 10000})

The above condition is if username is not equal to ram or amount is less than 10000, then the return value is T else the return value is the given message.

The above rule can be more generalized like sales executives can enter amount less than 10000 only.

To achieve this

1. Create a role for sales executives. All sales executive users should be assigned this role.

2. Set the validation expression for the amount field as iif(userrole#{executive} | amount <10000, {T}, {Executive can enter amounts less than 10000 only})