I cannot reproduce any of this behavior.
I created an App with a form section at the top and a grid underneath.
The form section is MSSQL and the grid section is MySQL.
I clicked the + icon in the relationship builder and connected the form section to the grid section. I then unchecked "Automatically relate" in the section attributes for the top form section.
I then selected the lower grid section and added a "parentdatachanged" delegate.
Code:
////////////////////////////////////////////////////////////////
// Event delegate for 'parentdatachanged' event
proc page1_section2_parentdatachanged()
? "parentdatachanged()"
ca = cursoradaptor("vt_actors")
ca.requery("last_name='MAVIN'")
endproc
"vt_actors" is the alias for the MySQL grid section.
Everything works as expected.
You can test your code interactively if you have any questions about whether it works or not. See below.
You can reset the requery() like this.
When requerying the data remember to get the active "search filter" and the "filter" if you are using that, and postfix this to your query so that the search panel is honored too. You can access these in the section like this:
Code:
Lianja.get("page1.section2").searchfilter
Lianja.get("page1.section2").filter
When using manual relationships like this in order to speed up the loading of an App you should specify "nodata=1" in the VT properties. This prevents any data being retrieved until a "where" condition is specified e.g. in the requery( [expression] ) call. When using VTs this is important for performance otherwise all the data will be retrieved on startup of the App in desktop apps only. Web/Mobile apps are specifically optimized so don't experience this behavior.
Here is an example of the performance metrics in my test desktop App relating MSSQL with 20k records to MySQL.
Note that there is an example_virtualtables app in the distro that you can study. It relates two virtual tables together using SQL statements with no parent->child relationship expressions.
There are always various ways that things can be done in Lianja.
Bookmarks