Search through relation

Hello Servoy users,

I mis probably something very simple ?

I have 2 tables : cnt_contact and com_communication with relation between the 2 cnt2com. I created a stored calculated field that contains all data on which I would like search : cnt_dc_recordview, and com_dc_searchall.
I would like to give user the ability to search on the 2 tables with only one search field.

I use the following method to search on all :

// start the search
controller.find()

//Take care of positionner field
// calculation summary search field
if (globals.p_text1)
	{
	cnt_dc_recordview = '%' + globals.p_text1 + '%';
	
	//search though relation if records
	if (cnt2com.getSize() > 0)
		{
		controller.newRecord();
		cnt2com.com_dc_searchall = '%' + globals.p_text1 + '%';
		}
	}
	
var found = controller.search();
if (found == 0)
	{
	plugins.dialogs.showWarningDialog('No records found', 'Enter new criterias and try again',  'Yes');
	// reload all records
	controller.loadAllRecords();
	// set focus on p_text1 and select data already in
	elements.f_p_text1.requestFocus();
	elements.f_p_text1.selectAll();
	}

But when the relation does not exists between the 2 tables the search always failed.
Is there a way to tell Servoy to don’t search when relation does not exists ?

I can go around creating dummy com_communication record for each contact, but I hope there is an other simple solution.

Thanks for your help.

:?:

DomTom

DomTom,

Servoy 3.5 has support for outer joins in relation which will allow the search you are looking for.
The first public beta will be available soon.

Rob