Object Views

An object view ties the current record, accessed by a SCRDTL rule or an object window, to records that have a one-to-many relation from it. An object view window displays those records and lets you select the record that you want to see detail for.

The following entries make up an object view definition. The number of DEFINE OBJVIEW statements in an object rules file is not limited.

Use To
DEFINE OBJVIEW

Begin each object view definition.

Put the title for the window that displays the record to the right of DEFINE OBJVIEW. The title is required and must be inside double quotes.

The standard for the title is the object of the window. For example, if the window displays vendors, the title would be Vendors.

ID Specify a unique identifier for this object rules object. For more information on IDs, see Object Rules Guidelines.
FILENAME Name the primary file that determines how this rule accesses records from the file named in RELATION.
VALIDITY Name one or two valid condition names, defined in the database definition, for the FILENAME. This entry is optional. Separate condition names with a comma. These conditions determine if Drill Around (F5) lets you select this object view from the Select Detail window. If the record does not meet the conditions, this object view title does not appear in the Select Detail window.
RELATION Name a valid one-to-many relation, defined in the database definition, for the FILENAME. This entry is required. The object view displays the one-to-many related records for the relation you enter and lets you select one.
CONDITION Name a valid condition for the related file defined by RELATION. This entry is optional.
DSPFLDS

Name fields from the related file named in RELATION that you want to display in the Object View window. The Lawson Software standard is to display the key field and its description.

To name a field from another file with a valid relation to the file named in RELATION, use the following syntax.

DSPFLDS RelationName.FieldName

If a one-to-many relation is used, the field from the first related record displays.

The size of the displayed field defaults to the defined field size. To override the default size, use the following syntax.

DSPFLDS FieldName=size
The label for a field in a Select window defaults to the defined field name (for example, the label for the field Acct-Unit is Acct Unit). To override the default field label, use the following syntax.
DSPFLDS FieldName[=size]:"Label"

The colon (:) is the override operator. Put the field label inside double quotes.

To display no field label, use the following syntax.

DSPFLDS FieldName[=size]:"
FNDFLDS Name other fields, not listed as DSPFLDS, that you want to use to find a record in the Object View window. These fields must be from the primary file or a related file. When you press Find (F2), you can find a record through the fields in DSPFLDS and FNDFLDS. This entry is optional.

Example for Object View Definition

When you select the object view Currency Relationships from the Drill Around select window, the object view uses the one-to-many relationship CURELAT to access all valid currency relationship records in the Currency Relationship file that are related to the active company record. Control passes from the General Ledger System file to the Currency Relationship file.

DEFINE OBJVIEW         "Currency Relationship"
       ID              GL-GLS-V-0015
       FILENAME        GLSYSTEM
       RELATION        CURELAT
       DSPFLDS         FR-CURR-CODE,FR-CUCODES.DESCRIPTION:
                       "From Currency"
                          TO-CURR-CODE,TO-CUCODES.DESCRIPTION:
                       "To Currency"

The From Currency Code, the From Currency Code Description, the To Currency Code, and the To Currency Code Description for the company record that the define form detail (DEFINE SCRDTL) accessed display in the window.

When you select a currency relationship record and use the Drill Around feature, the object windows and object views for the Currency Relationship file appear in a Drill Around select window.