The 'OR' in a query is a little bit more complex the for example the 'AND', but it's not impossible.
The following code should do the trick:
q = new Query();
qbds = q.addDataSource(tablenum(DirPartyTable));
qbr = qbds.addRange(fieldnum(DirPartyTable, recId));
qbr.value(strfmt('("%1" == %2.%3) || ("%1" == %2.%4)',
name,
qbds.name(),
fieldstr(DirPartyTable, firstName),
fieldstr(DirPartyTable, lastName)));
I just use the DirPartyTable as example. name is the argument that is passed to function.
The following code should do the trick:
q = new Query();
qbds = q.addDataSource(tablenum(DirPartyTable));
qbr = qbds.addRange(fieldnum(DirPartyTable, recId));
qbr.value(strfmt('("%1" == %2.%3) || ("%1" == %2.%4)',
name,
qbds.name(),
fieldstr(DirPartyTable, firstName),
fieldstr(DirPartyTable, lastName)));
I just use the DirPartyTable as example. name is the argument that is passed to function.