How to Enter an SQL-Type VPA Restriction for a Validated Table
How to Enter an SQL-Type VPA Restriction for a Validated Table
Use this type of restriction when you wish to apply a restriction to a particular validated table in a view. This example shows how to restrict Building Code foreign key values to entries that start with HQ or JFK.
- Add a new Role record or update an existing one. This example uses the Z-VPA-VALTBLS role.
- In the VPA Restriction field, enter the following. This restricts all Building Code foreign key values to those that start with HQ or JFK.
<restriction
type="forValidatedTables"
sql="#ASQL_VPAField() LIKE 'HQ%' OR #ASQL_VPAField() LIKE 'JFK%' ">
<title translatable="true">Validated Tables Restriction
on bl</title>
<validatingTable name="bl"/>
</restriction>
- Assign this role to a user. In the HQ sample data, this restriction is assigned to user Z-VPA-ROLE-VALTBLS.
- Log in as user Z-VPA-ROLE-VALTBLS.
- Open a view that contains the Building Code field as a foreign key, such as wr.
- Notice that only buildings that start with HQ or JFK are presented.