Page 1 of 1

Prim_tree and Sort VL-web V15

Posted: Tue Apr 29, 2025 10:04 pm
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

Re: Prim_tree and Sort VL-web V15

Posted: Thu May 01, 2025 10:48 am
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