Relations whit find()

Hi! I have a big trouble…

Im working with iReport, I have a foundset and i need to add filters in a foundset, to show the report.

This is my code:

/**
 * Function for open the report
 *
 * @param {JSEvent} event
 *
 * @properties={typeid:24,uuid:"1C693118-11DA-489E-A46B-DA2FFED534BB"}
 * @AllowToRunInFind
 */
function generateReport(event) {
	// Configure a Fs for call the function openReport

	// 1. The foundset of the form for create report
	var productosFs = forms.productos_tbl.foundset.duplicateFoundSet();
	productosFs.loadAllRecords();

	// 2. If the user want search only for one product filter the Fs
	productosFs.find();
	if (producto_id != null) {
		productosFs.producto_id = producto_id;
	}
	productosFs.search();
	
//productosFs.productos_to_boletines.find();
//productosFs.productos_to_boletines.boletin_fecha_cierre = ">=" + fecha_inicio;
//productosFs.productos_to_boletines.boletin_fecha_cierre = "<=" + fecha_final;
//var res = productosFs.productos_to_boletines.search();

	// 4. Call the function
	globals["openReportInForm"](event, "listadoLiberacion", productosFs, "productos_tbl", "Listado de liberación");
}

All works ok, but the comment code:

productosFs.productos_to_boletines.find();
productosFs.productos_to_boletines.boletin_fecha_cierre = ">=" + fecha_inicio;
productosFs.productos_to_boletines.boletin_fecha_cierre = "<=" + fecha_final;
var res = productosFs.productos_to_boletines.search();

This is my problem, it seems that i can’t filter one foundset with a relation.

I need filter this field because the form will have two fields: fecha_inicio and fecha_final, and I want the foundset, will be filtered for between this two dates.

Thanks in advance!

you assign 2 different values to the same field and then do the find, so only the last one wins, try too look at the between function

Thanks! the problem is solved, the error was the condition in the find(), I must set the format of date.