Hi,
I'm trying to update supportLanguageId for contacts according to below SearchEngine
SearchEngine se1;
se1.bypassNetServer(true);
se1.addData("person.supportLanguageId","2");
se1.addCriteria("person.contact_id.userdef_id.string01", "OperatorBeginsWith", "K");
se1.addCriteria("person.supportLanguageId", "OperatorEquals", "0");
se1.update();
It gives me below error, If I do an execute I get a list of contacts. I have tried removing bypassNetServer but i didn't help either.
Any ideas how to solve this?
Thanks!
Alle Svar (4)
Hi Johan
It's your "person.contact_id.userdef_id.string01" line that causes the exception. I don't think SearchEngine likes doing updates while doing joins.
Espen is correct.
You could do something like this:
SearchEngine se;
se.bypassNetServer(true);
se.addField("person.person_id");
se.addCriteria("person.contact_id.userdef_id.string01", "OperatorBeginsWith", "K");
se.addCriteria("person.supportLanguageId", "OperatorEquals", "0");
for(se.select(); !se.eof(); se.next())
{
SearchEngine se1;
se1.bypassNetServer(true);
se1.addData("person.supportLanguageId","2");
se1.addCriteria("person.person_id", "Equals", se.getField(0));
se1.update();
}