Why use controller.newRecord() in search method?

Hi all,

I was just digging a bit in the Servoy CRM example database and found this method at finding a contact:

 if(globals.searchContact)
{
	forms.contacts.controller.find()
	forms.contacts.contactname="#%"+globals.searchContact+"%"
	forms.contacts.controller.newRecord()
	forms.contacts.contacts_to_companies.company_name = "#%"+globals.searchContact+"%"
	forms.contacts.controller.search()

	// show all records if foundset = 0
	if(forms.contacts.controller.getMaxRecordIndex()==0)
	{
		globals.messageNoResults();  //subscript
		forms.contacts.controller.loadAllRecords()
	}
}
else
{
	forms.contacts.controller.loadAllRecords()
}
gotoContacts() //subscript

Why use forms.contacts.controller.newRecord() ?

it’s basically a new find request because it’s positioned between forms.contacts.controller.find() and forms.contacts.controller.search()

find marks the start of a find request
search fires the request

(this method searches for contactname OR companyname)

Thanks Maarten! :)