VLF-ONE Instance List SortAsColumn

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

VLF-ONE Instance List SortAsColumn

Post by jyoung »

I don't know if I am missing this with the new updates (EPC141050) to the VLF tooling but when using the default (VF_UM040O) Instance List how do you set a "SortAsColumn"?

I have a column that is a string type, its actually a formatted packed (15,2) that represents a currency amount as in $125.36.
I need to be able to have the list initially sorted on the packed value of the field.

In a normal list, I would add the packed field, hide it and set the string field's "SortAsColumn" to the hidden packed field.

Is there away to do this in VLF-ONE?

For that matter, how do you control the initial sort? Again in the normal list, I could set the sort position and direction but I am not seeing how to do with VF_UM040O.

Thanks,
Joe
MarkDale
Posts: 116
Joined: Wed Dec 02, 2015 10:06 am

Re: VLF-ONE Instance List SortAsColumn

Post by MarkDale »

Hi Joe,

For numeric columns, VF_UM040O already has a hidden numeric column and a visible character version of it. When the user sorts the visible character column, the actual sort is done using the hidden numeric column.

So perhaps the solution is to add the data to the instance list as an NColumn, rather than as an AColumn.

To get the order you want, you could either add the items in the order you want.
or there is a shipped example DF_T3002O that shows how filters can programmatically sort an instance list column.

Regards
Mark Dale
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: VLF-ONE Instance List SortAsColumn

Post by jyoung »

Hi Mark,

I have to put the dollar sign "$" in the field and I have yet to figure out how to format a numeric value to include it, so I have to use a string field.
If you know how to do that please share!

From the examples you pointed out, however I was able to come up with a workaround.

I added the AColumn1 and NColumn1 which has the formatted value and the actual value respectively.
Then after the data has been added I can manipulate the columns.

Code: Select all

set com(#listManager.InstanceListBrowser.AColumns<1>) sortascolumn(#listManager.InstanceListBrowser.NColumnsVisual<1>) sortposition(1) sortdirection(Descending)
set com(#listManager.InstanceListBrowser.NColumnsVisual<1>) columnvisible(false)
Seems to be working great.

Thanks!
Joe
MarkDale
Posts: 116
Joined: Wed Dec 02, 2015 10:06 am

Re: VLF-ONE Instance List SortAsColumn

Post by MarkDale »

Hi,

Unfortunately there isn't a way to specify a currency in a field in a VLF-ONE standard instance list. We only have the standard edit codes and no option to specify a currency.

If it was an ordinary lansa list and field you could try giving the lansa field an edit word like this: '$ 0. &CR'

Your solution is quite clever though.

Along those lines, in epc141050, there is access to the PRIM_LIST object in VF_UM040O (#AVLISTMANAGER.avVisualList).

It has all the PRIM_LIST properties including a collection of columns.

Provided you are cautious and careful, it might help you with these kind of tasks.

Regards
Mark Dale
Post Reply