addTableFilterParam not refreshing contained form.

I have a textbook header/detail form, in other words:

  1. A main form with customer information at the top.
  2. A tabpanel on the main form below containing another form, which has a TableView for transactions.
  3. A relation so that the transactions displayed are for the customer being viewed.

Which all works fine. I also added a checkbox so that I could toggle the display of transactions with zero balances. Here’s the code (The checkbox is bound to the form variable ‘outstandingOnly’).

function filterCheckBox_onDataChange(oldValue, newValue, event) 
{

	var success = false;
	
	if (outstandingOnly == true)
	{
		success = databaseManager.addTableFilterParam('testdb', trans', 'st_trbal', '!=', 0, 'balancefilter');
	}
	else
	{
		success = databaseManager.removeTableFilterParam(testdb', 'balancefilter');
	}

	if (!success) 
	{
		application.output('Adding table filter operation failed');
	}
		
	forms.CustomerTransactions.foundset.loadRecords();
	
	return true;
	
}

That fires and adds/removes the filter as intended, however the displayed records in the TableView never change.

Alan,

I tried in a similar sample and it worked fine.
Even without the foundset.loadRecords() call the tableview was refreshed automatically on the filter calls as expected.

Check if your tableview foundset is affected by the filter.

Rob

Hmmm … I changed things so it was working against an account with many transactions. The filter checkbox now reduces/increases the record count in the TableView as it is ticked on and off, however the same record is repeated for each row in the tableview, where it should be different records. Grrrrr …

Found it … I had specified the row ident on the transactions table as being the account code (which is of course repeated in many records) as opposed to the UID field that it should have been. :oops: