The document will provide one of the method to restrict visibility of certain fields using custom capability words in the classic SM systems.
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)
1. Create a custom capability word : “restrict.field.visibility” (can be anything)
2. Edit the vendor format making the field read only
3. 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)
4. 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.
5. Set the custom capability word in the operator record which
6. Test it by logging in with an ordinary user account with and without the new capability word.