(SM) Support Tip: How to restrict visibility of certain fields using custom capability words
Every SM user can query against a file, at times there is requirement where SM operators does not have to see certain fields in the records. One way of achieving this is via custom capability word and format control to pre-set a field value.
The below example prevents users from seeing phone number field in the vendor record, except those operators who has the custom capability word. The format control will initializes the configuration and will set the custom field to value.
For simplicity this example uses the vendor file and restricts access to field phone number. (It can be any field in any record)
- Create a custom capability word : “restrict.field.visibility” (can be anything)
- Edit the vendor format making the field read only
- Modify the vendor format control record as below:
Display : true
Calculation: if (index("restrict.field.visibility", $lo.ucapex)=0) then ($var.field=false) else ($var.field =true)
- Modify the Vendor form record as below:
Form : vendor.g
Object type: Text
Property : Value
Visible condition: [$var.field]
$var.field = user defined variable
$lo.capex = Array variable holding the operators capability word
index() = It returns the position of the first argument passed.
- Set the custom capability word in the operator record which
- Test it by logging in with an ordinary user account with and without the new capability word.