Hello
I have a problem with loading records into a portal. When I use the following code, the records are only loaded into the portal, when the script is triggered two times (here i only show the begining of the select statement; i use four unions and a couple of joins - the select, however, is correct…). With the first attempt, the portal becomes visible, but the records only show with the second triggering. I don’t recall having this problem in earlier servoy versions. Is there a problem with my code? Has anyone seen something similar?
Thanks a lot,
Reto
var query = 'select os.obj_id… ’
var pkdataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, maxReturedRows);
first you do a visible (of a portal element?) of the current form.
Thne you are setting a pkset in a completel different form. What is the relation between that form and the current form where the portal is on?
The form I’m doing this from is named “check_in_form”. On this form I have portal named “select_lesson”, in which i want to display the form “select_lesson_list” (with the result of the sql query).
I have the same behavior on other forms with portals…
I wasn’t able to reproduce the behavior in a sample solution. It works perfectly there. I tried with Servoy and with MySQL tables (my solution uses MySQL).
Now I just use the “…loadRecords(pkdataset);” line twice and it works. Not very elegant, but it does the job…
Have you tried this by loading the records first and then making the tabpanel visible !?
Just curious if it would work and then may point Johan to a reason why the original method order may cause a problem
[muse]
Using the loadRecords() twice reminds me of the old FileMaker bug where the ‘go to related record command’ would not work sometimes unless you invoked the script step twice !!
[/muse]