Intermittent blank record "loadrecords()"

I am using the following code to go to a company record from a contact record. I am fining from time to time I get a blank result but if I try again the result works ok.

forms.company_frm_main.controller.loadRecords(forms.contact_frm_main.contact_to_company.company_id);
	forms.company_layout_main.controller.show();

I am at a loss as to why it is happening. Refer to http://4xjbh.com/capture-1.mp4 for example…

Thanks

This might be related to an issue (resulted in an invalid selected record index) that is fixed in Servoy 5.1 final - will be released soon.
Try it out, and if the problem persists please create a case in our Support system (a sample solution would be ideal).

As a workaround try something like this and see if it works:

forms.company_frm_main.controller.loadRecords(forms.contact_frm_main.contact_to_company.company_id);
if (forms.company_frm_main.controller.getMaxRecordIndex() > 0) forms.company_frm_main.controller.setSelectedIndex(1);
forms.company_layout_main.controller.show();

Thanks. I thought I was going crazy. The work around seems to be working OK.

I will hold off changing anything until 5.1 comes out “soon”…