Adding Entries to the Instance List

Visual LANSA Framework

Adding Entries to the Instance List

The different types of objects may be added into the instance list in two different ways:

By the filter. The AddToList method has a new optional BusinessObjectType() parameter that allows filters to add different business object types to the same instance list. If passed as blanks/nulls or not specified this parameter defaults to the business object that owns the filter.    

By a relationship handler. In a CHILD relationship only you can optionally specify a relationship handler. This is either an RDML function, or a reusable part, that is called to dynamically "expand" the relationship between a parent and child object. By doing this you can improve filter performance by only adding root or parent objects to the instance list initially.

For a sample of such a function see:

When objects exist in parent/child relationships there is assumed to be an inherent hierarchical relationship in the way that their programmatic identifiers are used in the instance list. 

For example, if Product used AKey1(#Product_Number) to uniquely identify itself,  the children BOMs and Costs are also expected to include the same (and correct) product number as their AKey1 values. They would both also use additional AKeyN and NKeyN values as well to uniquely identify themselves.

Since the instance list in this example now contains mixed objects (ie: Products, BOMs and Costs) there are some new considerations. For example, if the user right clicks on a BOM but elects to display the Details of the Product:

The Product Details command handler is invoked and displayed.

When it gets the current instance list entry it will actually get the currently selected BOM instance list entry. The program can tell this because the GetCurrentInstance method now optionally returns the BusinessObjectType value of the instance.

Most likely the Product Details command handler does not need to know the specific BusinessObjectType because the inherent hierarchical relationship in the programmatic identifiers used for Products, BOMs and Costs all put the product number in AKey1 … which is all that the Product Details command handler really needs to know.