Testing 3.5 with our current solution and have a strange problem.
We’ve used navigational global methods all over our solutions like this:
var fs_fv_record = fs_invoiceid
var dataset = databaseManager.convertToDataSet(fs_fv_record);
application.setStatusText(fs_fv_record)
forms.fs_invoice_main.controller.showRecords(dataset)
This works fine in 3.1.6, but in 3.5 it doesn’t work.
Following the method in the debugger, it:
Sets fs_fv_record correctly
converts to dataset correctly (JSData set size = 1, selected row = -1)
Shows the forms
Form has no records.
We’ve tried using a loadRecords then a show, but this doesn’t work either.
If we use a showRecords or loadRecords using a relation - loadRecords(relation) - it works fine.
Is there some reason forms in 3.5 will no longer load a dataset created by convertToDataSet ?
What would be another good method to load a single record using a PK? We’d rather not use scripted FINDS.
(need to use PK’s, not relationships as some have multiple children and we only want the one to load)
So 3.5 + it must be an array? Previously, you could just use a PK (even a literal) in there.
Perhaps it was never supposed to work when not in array form but did by default
Thanks for pointing that out Roclasi.
Anyone else use other methods to generically load a single record?
Servoy should implement a loadRecords method that will accept the PK of the table the form is based on - all these double-firing of queries or converting of datasets just to load a particular record is inefficient.
I’ve seen this requested before and was surprised I haven’t seen it in 3.5 when I started testing. Or am I missing it somewhere?
The converting process of an array to a dataset does not involve queries and should be super fast. So except for a bit complex handling to get the desired result this is not really a problem.