Cannot addFoundSetFilterParam to related foundset

Hi,
I have the follow method:

function timbre(event) 
{
	g_analisis.analisis_to_facturamov.addFoundSetFilterParam('codigo_tim','=',7,'Timbre')
	g_analisis.analisis_to_facturamov.loadAllRecords()
	if(g_analisis.analisis_to_facturamov.getSize()== 0)
	{
		foundset.newRecord()
		foundset.id_anal = globals.idAnalisis
		foundset.fecha_mov = application.getServerTimeStamp()
		foundset.codigo_tim = 7
		foundset.codigo_mo = 1
	}
	else
	{
		plugins.dialogs.showErrorDialog("","YA SE INGRESO REGISTRO TIMBRE","")
	}
	g_analisis.analisis_to_facturamov.removeFoundSetFilterParam('Timbre')
	g_analisis.analisis_to_facturamov.loadAllRecords()
}

In Servoy 5.1.3 works perfectly but in Servoy 5.2.2 I get an error message: “Cannot addFoundSetFilterParam to related foundset”

Any clue about it?
Thanks

by the way: when i debag the relation has records

this is a bug that is fixed in servoy 5.2
You shouldnt be able to add foundset filters on a relation. Because a relation is shared over many things and also there are many actual foundset instances of the same thing (the next record has the same relation but it is memory a different thing) so which one do you set it on? The one from record X or the one from record Y

Thanks a lot.

Johan,

I came across this as well when I moved from 5.1 to 5.2, but have since coded around it (I was using foundset filter param on realted foundsets in 5.1 and before fairly frequently). Now though, after moving from 5.2.2 to 5.2.4 I notice a new issue. Aparently I can’t use a related dataprovider to filter a non related foundset. Is this intended?

In 5.2.2 and before, the below code worked. Now it does not.

function onLoadEvnt(event) {
	_super.onLoadEvnt(event)
	foundset.addFoundSetFilterParam('order_item_is_receivable', '=', '1', 'batches');
	foundset.addFoundSetFilterParam('order_item_to_order.is_finalized', '=', '1', 'batches');	
	foundset.loadAllRecords();
}

Jeff,

Foundset filters are (and always have been) on columns, you cannot supply a related dataprovider there (foundset.addFoundSetFilterParam will return false).

Rob

Foundset filters are (and always have been) on columns, you cannot supply a related dataprovider there (foundset.addFoundSetFilterParam will return false).

Hi Rob,

Thanks for the reply. This did work prior to 5.2.4. I never checked the return value per se, but the filter got applied. But if it was never meant to work, then I suppose it won’t work going forward so I’ll take that into consideration.

Thanks