Limiting the List of Tables Available for Generic Inquiries

You can limit the list of database tables available for constructing generic inquiries on the Generic Inquiry (SM208000) form in the production environment. To do this, in the development environment, use the following approach:

  1. Create the GITables.xml configuration file to specify the Allowed and Hidden collections of masks for the full names of the database tables, as described in The Contents of the GITables.xml File.
  2. Save the configuration file to the App_Data folder of the website.
  3. Add the file to a customization project as a File item. (See To Add a Custom File to a Project for details.)

The platform automatically checks whether this file exists in the App_Data folder. If the customization project is published in the production environment, the platform applies the file content when a user selects a table for a generic inquiry on the Generic Inquiry form.

The Contents of the GITables.xml File

The configuration file is in XML format and includes the GITables element only. This element must include the Allowed section and can also contain the Hidden section. Each section is a collection of Table elements.

The Allowed collection specifies the list of tables that are available for use in generic inquiries constructed on the Generic Inquiry form. If a table isn't included in the Allowed collection, it doesn't appear in the list for selection on the Table tab of the form. You can also add the Hidden section to the configuration file. This section specifies the tables you want to exclude from the list.

If a table is allowed and not hidden (as illustrated by the green area in the figure below), it is included in the list of the tables available for constructing generic inquiries on the Generic Inquiry form. Otherwise, the table is not displayed in this list of tables.



Each Table element of the Allowed and Hidden sections contains the FullName attribute, which specifies the table name or the mask for a set of tables.

The attribute value is a string that can contain the following wildcard characters:

  • An asterisk (*), which matches any number of characters (or no characters)
  • A question mark (?), which matches exactly one character
The example below shows how to exclude the tables by using the PX.Objects.CR.BAccount and PX.*Contact* masks.

<?xml version="1.0" encoding="utf-8"?>
<GITables>
	<Hidden>
		<Table FullName="PX.Objects.CR.BAccount" />
		<Table FullName="PX.*Contact*" />
	</Hidden>
	<Allowed>
		<Table FullName="*" />
	</Allowed>
</GITables>

According to the mask with Contact, users will not be able to use any tables that contain the word Contact in the table name in their inquiries (for example, the PX.Objects.CR.Contact table).

To limit the list of database tables by using only the Allowed collection, you can empty or remove the Hidden section. The following example shows how to include only the tables that matched the PX.Objects.IN.* mask.

<?xml version="1.0" encoding="utf-8"?>
<GITables>
	<Allowed>
		<Table FullName="PX.Objects.IN.*" />
	</Allowed>
</GITables>