I have 2 forms currently. The first form is a docket form. Part of the Docket is a companyid which corrisponds to the primary key of the Company table. I need to select a company for the docket but do to the large number of companies I cannot use a dropdown (4500+ records). I have built a second form which I called CompanySelect. I have a button on the docket form that causes the CompanySelect form to display (in list view). There is a button beside each record which passes the selected company back to the docket form to change the companyid of the docket.
My problem is I want the CompanySelect form to goto the currently set company for the docket and it is not working correctly. I am using the following code called from the dockt form:
forms.CompanySelect.controller.loadAllRecords();
forms.CompanySelect.foundset.selectRecord(companyid);
forms.CompanySelect.controller.show();
The first time that the CompanySelect form displays the first record in the foundset is always selected regardless of what record is supposed to display. After the first load if I go back to the CompanySelect form the correct record will be displayed as long as the record is one of the first 200 in the list. If I scroll down the list and select a record >200 in the list then when I come back to the form it will go to the correct record. However, if I filter the list and then select the record and then return to the docket and try to select a Company again the selected record will be whatever position that the filterd lists record position was but of course because loadAllRecords was called the list will be showing the entire list not just my filtered list so the index position was wrong.
Does anyone know how to get around this or see what I am doing wrong?.