Prim_tree and Sort VL-web V15

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
kno_dk
Posts: 219
Joined: Tue Feb 23, 2016 12:00 am

Prim_tree and Sort VL-web V15

Post by kno_dk »

Hi.

I have an application with a PRIM_tree and the setup/design is handled in a RP. This has worked fine until now.
Now the customer wants to sort on different fields in this RP.

I have looked at the examples in DEM partition and tried to make it similar, but I can not get it to work
I have this code:
Mthroutine Name(OnSort) Help('Executed when the "Sort" method is used in the Tree') Options(*REDEFINE)
* godkender eller bilagsnummer eller kreditor
Case Of_Field(#Key)
When Value_Is(= "GODK")
When Value_Is(= "BILAG")
When Value_Is(= "KREDITOR")
#Result := #INSACCOUN.Compare ((#CompareTo.Design *As #IBAfvgTreeList).KREDITOR)
Endcase
Endroutine

and it gives me this error:
#INSACCOUN.Compare ((#CompareTo.Design *As #IBAfvgTreeList).KREDITOR) is not a valid name.

#IBAfvgTreeList is the name of the RP

Does anybody have a simpel exsample of the sort with PRIM_TREE and RP and want to share?

/klaus
Tim McEntee
Posts: 57
Joined: Thu May 26, 2016 8:46 am

Re: Prim_tree and Sort VL-web V15

Post by Tim McEntee »

Hi Klaus

I can't see the full code but I am going to guess that the component you are using for the *as part is incorrect.

In your code you will have
define_com class(#prim_list<#myDesign>) name(#IBAfvgTreeList)

* your code
#INSACCOUN.Compare ((#CompareTo.Design *As #IBAfvgTreeList).KREDITOR)
* should be
#INSACCOUN.Compare ((#CompareTo.Design *As #myDesign).KREDITOR)

Tim
Post Reply