Hello,
I have defined a simple DataEnvironment class in code "example.prg", containing a couple of Cursor objects and a Relation:
In its Init( ) event code I call .OpenTables( ) and set the .InitialSelectedAlias to .cur_1.Alias, while in the Destroy( ) event code I call .CloseTables( ). I added in my form definition DEClassLibrary = "example.prg" and set DEClass = "dte": all works as expected, as I can see on a Grid.
Now I would like to see tbl_2 records in a different order. If I try to set the .Order property of the child table using Order = "tag_2", it is completely ignored (as stated under Order property in the Help file). How can I display records on my Grid in a different order (tbl_2 has several more tags than the one used in RelationalExpr), using tbe above method of Cursor and Relation objects?
Also, I do not seem to be able to address the DataEnvironment instance in my form methods, it seems as there is no such object contained in it (unlike what I see under DataEnvironment property in the Help file).
I have defined a simple DataEnvironment class in code "example.prg", containing a couple of Cursor objects and a Relation:
Code:
DEFINE CLASS dte AS DataEnvironment
[indent]ADD OBJECT cur_1 AS Cursor WITH Alias = "tbl_1", CursorSource = This.cur_1.Alias, Database = "dbc\database.dbc"[/indent]
[indent]ADD OBJECT cur_2 AS Cursor WITH Alias = "tbl_2", CursorSource = This.cur_2.Alias, Database = "dbc\database.dbc"[/indent]
[indent]ADD OBJECT rel AS Relation WITH ParentAlias = "tbl_1", ChildAlias = "tbl_2", ChildOrder = "tag_1", RelationalExpr = "field_1"[/indent]
ENDDEFINE
In its Init( ) event code I call .OpenTables( ) and set the .InitialSelectedAlias to .cur_1.Alias, while in the Destroy( ) event code I call .CloseTables( ). I added in my form definition DEClassLibrary = "example.prg" and set DEClass = "dte": all works as expected, as I can see on a Grid.
Now I would like to see tbl_2 records in a different order. If I try to set the .Order property of the child table using Order = "tag_2", it is completely ignored (as stated under Order property in the Help file). How can I display records on my Grid in a different order (tbl_2 has several more tags than the one used in RelationalExpr), using tbe above method of Cursor and Relation objects?
Also, I do not seem to be able to address the DataEnvironment instance in my form methods, it seems as there is no such object contained in it (unlike what I see under DataEnvironment property in the Help file).