To add a derived field
- In the Infor Rich Client, access the Configuration Console for Application.
- Select Business Classes and, if a business class configuration does not already exist for the business class you want to add a field to, select the New button at the top of the left pane and then select User Field as the configuration type in the dialog box that appears. If the business class configuration already exists, expand the business class, select User Fields, and click the Create button at the top of the left pane.
- Select the business class for the field, select Derived as the field type, and then click OK.
-
Define the derived field.
- Business Class
-
The business class you selected for the derived field (display-only).
- Field Name
-
Enter a name for the field. It cannot begin with a lowercase letter or contain spaces. Be sure to follow your configurations naming conventions and prefix the name with a code such as ZZZ, Usr, or characters that represent your company name (for example, ACM for Acme Co).
- Default Label
-
Enter the label to be used as a default for the field. You can add translated labels by clicking the globe icon and defining Locale Translations.
- Field Type, Size, Decimals
-
Select the field type, and, if appropriate, enter the size and the number of decimals.
- Definition
-
Enter the LPL definition for a derived field. It may be useful to view the LPL for several business classes to become familiar with the LPL syntax.
Example 1
This example shows a definition that simply returns the value of a field. The return statement is required at the end of all definitions.
return AnniversaryDate
Example 2
This example shows how to return a substring of an alpha field.
return LRCAlphaAnniversaryDate[5:6]
Example 3
This example shows how to include if clauses in a definition
if (AgeCompute > 0) RoundedValue.RoundInput = AgeCompute RoundedValue.RoundingType = RoundedValue.RoundingType.Low RoundedValue.RoundTo = 1 RoundedValue.RoundingMethodFW = RoundedValue.RoundingMethodFW.MultipleOf return RoundedValue.RoundResult else return 0
Example 4
This example shows how to invoke a script
CurrentTemperature is a DerivedField type is Numeric size 3 return getTemp(ZipCode) in script "Weather"
-
Click the Save button at the top of the right
pane.
The new derived field is now available to be added to a form configuration.