OpenAgencyPopupSearch

You can use the default system popups or lookups to inquire on many tables in Infor Public Sector. Agencies can add fields and use the default popups to show lists of values for those fields. This is most commonly performed with code definitions and client defined tables.

However, certain lookup forms require more complex searching and record filtering. The most common examples are the address, contact, and asset lookups. These search forms have been created with custom functionality to filter multiple tables in a context-specific fashion.

You can use the OpenAgencyPopupSearch method to invoke these forms from client detail pages by specifying the correct rule on an edit box or grid column. The parameter for this method is the type of search your custom field is bound to. These are the currently supported values:

  • ADDRESS: Shows the localized Address popup.
  • CONTACT: Shows the Contact popup.
  • LICENSED: Shows a popup list of contacts who have valid licenses.
  • CONTRACTOR: Shows a popup list of contacts who are designated as contractors.
  • ASSET: Shows the popup for the asset type the field is bound to.
  • ASSET,[comptype]: Shows the popup for an agency-defined asset type. The comptype is required to get the correct asset type. For example, if you have an agency-defined asset type called Server with a comptype of 1003, you would specify OpenAgencyPopupSearch(ASSET,1003) to show the Server Lookup. Infor Public Sector shows the comptype for each agency-defined asset type in the Asset Type # field at the top of the Asset Type InfoViewer.
  • BUDGET: Shows the Budget Number popup.

The field from which you show the popup must be bound to the primary key of the associated table, such as AddressKey for the address popup or AssetKey for an asset. You must therefore create a foreign key link from the agency table. This can be done as a one-to-one or one-to-many cardinality relationship.

For asset popups, you must create the foreign key link to the table for the specific asset type, such as COMPSMN for sewer mains or COMPBR for bridges, rather than the COMP table. Note that all agency-defined asset are stored in the same three tables, depending on the asset class: COMPAGENCYSIMPLE, COMPAGENCYNETWORK, or COMPAGENCYSEGMENT.

Next, add an edit box or a grid column to your detail page and bind it to the foreign key that you just added.

Set the HasPopupButton property to TRUE and add an OnPopupSelectedRule with the appropriate parameter, such as OpenAgencyPopupSearch(ADDRESS) or OpenAgencyPopupSearch(ASSET). If the field will be displayed in an InfoViewer, you should also set the DisabledCanEdit property to true so it will be editable when you click the Edit button.

Clicking this field’s popup button on the detail page will now open the correct lookup, which you can use to search for and select the record that you want to load. The field you added only shows the record’s primary key, but you can add additional fields to show additional information.