Reloading a Form

Hi,

I have 3 buttons :

  1. button1 (performs a search based on a fields content and filters out the display to show only the searched for content on a tab panel form in table view )

  2. button2 (selects the current row displayed and filters out displays only its content on a tab panel form in table view )

  3. button 3 (displays all records after a search or current row selected in the Tab panel)

Button 1 and 2 work fine but button 3 only works after the search not after the single row was selected i.e. after button 2 was clicked.

Code :

Button 1 (works fine):
forms.frm_nav_main.controller.find()
forms.frm_nav_main.order_child_id_to_child.child_sname = searchStr
forms.frm_nav_main.controller.newRecord()
var found = forms.frm_nav_main.controller.search()

Button 2 (works fine):
var success = foundset.addFoundSetFilterParam(‘child_ID’,‘=’,order_child_id_to_child.child_id);
foundset.loadAllRecords();
controller.sort(‘child_id asc’)

Button 3 (works fine after button 1 but no change after button 2 clicked):
forms.lst_orders.foundset.loadOmittedRecords();
var success = foundset.addFoundSetFilterParam(‘school_ID’,‘=’, globals.Glb_School_ID);
foundset.loadAllRecords();

I’ve tried controller.loadOmittedRecords() and controller.loadAllRecords(); foundset.loadAllRecords(); foundset.loadOmittedRecords(); no differnence, they all work after button 1 not Button 2?

Any suggestions as to why Button 3 dosen’t do anything after Button 2 is clicked or how I can get a form back to the first time it was loaded ?

loadOmmitedRecords does nothing after a loadAllRecords, because there are simply no omittedrecords.

the foundset filter is just a perminent filter, do not use it in conjuction with omittedRecords()

you set it in a startup or onShow method, and don’t touch it again.