How to Enter a VPA Restriction for a Field
You can apply a VPA field type restriction which includes all fields with a given name. This topic describes two types:
- restricts the Drawing Name field to show drawings whose name starts with HQ
- restrict views containing the Telecom Service Level field to records whose value is set to Voice.
Example 1: Restricting Drawings a User Can Access
- Add a new Role record or update an existing one. This example uses the Z-VPA-DWGS role.
- In the VPA Restriction field, enter the following for the Z-VPA-DWGS role, which restricts all views that contain the Drawing Name field to those records whose Drawing Name value start with HQ. This includes the drawings shown in the Drawing List.
<restriction
type="forFields"
sql="#ASQL_VPAField() LIKE 'HQ%'">
<title translatable="true">Fields-Named Restriction on
dwg_name</title>
<field name="dwg_name"/>
</restriction>
- Assign this role to a user. In the HQ sample data, this restriction is assigned to user Z-VPA-ROLE-DWGS.
- Log in as user Z-VPA-ROLE-DWGS.
- Access the Drawing List. Notice the Drawing List only shows drawings whose name stars with HQ,
- Open a view that contains the Drawing Name field, such as afm_dwgs. Notice that it only presents drawings that start with HQ.
Note: This type of drawing restriction does not prevent users from manually opening drawings using File/Drawing/Open or drag and drop.
Example 2: Restricting Views whose Telecom Service Level is Set to Voice
- Add a new Role record or update an existing one. This example uses the Z-VPA-FLDS role.
- In the VPA Restriction field enter, the following for the Z-VPA-FLDS role, which restricts all views that present the Telecom Service field to those records whose Telecom Service field is set to Voice.
<restriction
type="forFields"
sql="#ASQL_VPAField() = 'V' " >
<title translatable="true">Fields-Named Restriction on
tc_service</title>
<field name="tc_service"/>
</restriction>
- Assign this role to a user. In the HQ sample data, this restriction is assigned to user Z-VPA-ROLE-FLDS.
- Log in as user Z-VPA-ROLE-FLDS
- Open a view that contains the Telecom Service field, such as eqstd.avw. Notice that it only presents records whose eqstd.tc_service = Voice.