Using the instance list

In VLF, the standard layout consists of the menu (with applications and their sub-business objects), the filter, the instance list and the command handler. The instance list is set in the VLF designer, where the sequence and types are set.

The instance list has to visual identifiers (VisualID1 and 2) that are used as GUI keys, directed at the user, and a number of numeric and alphanumeric keys (Nkey1+ and Akey1+). Then there is option of 10 alphanumeric values (AColumn1-10), 10 numeric values (NColumn1-10) and 5 date values (DColumn1-5) – and more can be added, if you really need to. The visual GUI keys are also used in the header for the command handler.

Adding to the instance list is often done from the filter, as in

Invoke Method(#avListManager.AddtoList) Visualid1(#OPSID.AsString) Visualid2(#ITEMID) Nkey1(#LISTCOUNT) Nkey2(#OPSID) Nkey3(#COUNT1) Nkey4(#COUNT2) Akey1(#RECNAME) Akey2(#SNAME) Akey3(#ART) Acolumn1(#RECNAME) Acolumn2(#SNAME) Acolumn3(#ART) Ncolumn1(#COUNT2) Ncolumn2(#PRICE) Ncolumn3(#TOTAL)

surrounded by an appropriate use of

Invoke Method(#avListManager.BeginListUpdate)
Invoke Method(#avListManager.ClearList)
Invoke Method(#avListManager.EndListUpdate)

Updating an instance is done by

Invoke Method(#avListManager.BeginListUpdate)
Invoke Method(#avListManager.AddtoList) Visualid1(#OPSID.AsString) Visualid2(#ITEMID) Nkey1(#LISTCOUNT) Nkey2(#OPSID) Nkey3(#COUNT1) Nkey4(#COUNT2) Akey1(#RECNAME) Akey2(#SNAME) Akey3(#ART) Acolumn1(#RECNAME) Acolumn2(#SNAME) Acolumn3(#ART) Ncolumn1(#COUNT2) Ncolumn2(#PRICE) Ncolumn3(#TOTAL)
Invoke Method(#avListManager.EndListUpdate)

which will either insert a new instance or, if the keys match an existing instance, replace an instance.

Then, in the command handler the selection can be read with

Invoke Method(#avListManager.GetCurrentInstance) Visualid2(#ITEMID) Nkey1(#LISTCOUNT) Nkey2(#OPSID) Nkey3(#COUNT1) Nkey4(#COUNT2) Akey1(#RECNAME) Akey2(#SNAME) Akey3(#ART)

Thus values from the selection in the instance list can be passed to the command handler. If other values need to be passed from the filter (or other command handler) to the command handler, it can be done using the save and restore, like:

Invoke Method(#avFrameworkManager.avSaveValue) Instance(15) Withid1(CHOICE) Fromavalue(#CHOICE)
Invoke Method(#avFrameworkManager.avRestoreValue) Instance(15) Withid1(CHOICE) Toavalue(#CHOICE)

Notes in sizes:
VisualId1 and AKey1 to AKey5 are alphanumeric 32
VisualId2 is alphanumeric 50
NKey1 to NKey5 are signed 15,0
AColumn1 to AColumn10 are alphanumeric 100
NColumn1 to NColumn10 are signed 30,9
DColumn1 to DColumn5 are alphanumeric 19

Leave a comment