SubTypes

Visual LANSA Framework

SubTypes

Business objects may optionally have a SubType associated with them.

For example, a business object named BankAccount might be sub-typed as being a Savings, Check or Investment Account.

The purpose of subtypes is to allow the display of commands (and their associated tabs) for the business object to be conditioned so that they are only visible and useable for certain subtypes.  

For example, the command/tab named Transactions might only be validly displayed for Check and Investment accounts.

Likewise, the command/tab named Charges might only make sense when used with a Savings account.  

Subtypes are represented by a code that you can associate with a business object instance. For example you might choose the codes SAV, CHK and INV for the 3 BankAccount subtypes.

You specify how commands and subtypes are related by using the SubTypes tab associated with the business object. For example:

 

 

SubTypes should be no more than 5 characters long, and contain uppercase letters of the English alphabet (A ->Z) or numbers (0 -> 9) only.

The values ALL, NONE, ALLOTHERS and OTHERS should not be used for SubTypes.

SubTypes are only applicable to instance level commands/tabs.

Any Command that is not enabled for all subtypes needs to have its Default Command option set to 'Never'

Once you start using subtypes for a business object instance list you should use them for every instance list entry. 

When you insert or update an entry into an instance list you may optionally specify a subtype to be associated with the entry.

 

Examples In VL Components and WAMs

Case #T_TYP

 

when (= SAVINGS)

 Invoke Method(#avListManager.AddtoList) AKey1(#T_Acc) VisualID1(#T_Acc) Visualid2(#T_Nam) AColumn1(#T_Typ) NColumn1(#T_BAL) SubType(SAV)

 

when (= CHECK)

Invoke Method(#avListManager.AddtoList) AKey1(#T_Acc) VisualID1(#T_Acc) Visualid2(#T_Nam) AColumn1(#T_Typ) NColumn1(#T_BAL) SubType(CHK)

 

when (= INVESTMENT)

Invoke Method(#avListManager.AddtoList) AKey1(#T_Acc) VisualID1(#T_Acc) Visualid2(#T_Nam) AColumn1(#T_Typ) NColumn1(#T_BAL) SubType(INV)

 

Endcase

 

Other Examples

Working examples of SubTypes are shipped in the Programming techniques Application (Advanced examples). Refer to the shipped example VL components DF_T2801/02 and WAMs DM_T2801/02.

These properties are set in the Business Object Subtypes tab.