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() ?