Formula fields

You can use formula fields to create more complex mappings from the GIS database to the Infor Public Sector database.

For example, the data that is stored in one field in the Infor Public Sector database might be stored in two different fields in the GIS database. In that case you can use a formula to concatenate the two fields.

To create a formula field, right-click the Formula Fields node in the GIS Fields tree and select Create New. There are two types of formulas that you can create:

  • Use the Get Value Formula field to create a formula that retrieves data from the database and assigns it to a return value.
  • Use the Set Value Formula field to create a formula that adds data to the database.

After you create a formula field you can map it to the appropriate field in the Infor Public Sector database, just as you would map any other field.

For example, a county's address records use two fields to store unit numbers such as suite numbers: Unit_Indicator stores the type of unit, such as suite or apartment, and Unit_Number stores the actual number.

The entire unit number is stored in the STSUB (StreetSubDesignation) field in the Infor Public Sector database, such as Ste 101, so a get value formula is needed to concatenate the unit indicator and the unit number. This sample formula combines the two values and assigns them to a variable called formattedUnitNumber:

dim res as Result=Result.Success
retval = ""

dim formattedUnitNumber as string = oContext.GisFeature.Attributes
    ("Unit_Indicator") + " " + oContext.GisFeature.Attributes("Unit_Number")

if not string.IsNullOrWhiteSpace(formattedUnitNumber) then
    retval = formattedUnitNumber
end if