Add a condition to a form datasource with OR on two columns
<p>I have to build a specialized form which queries the <code>InventTrans</code> table for some purchase transactions.</p>

<p>The transactions must be selected, either with a non-empty Voucher, either with a non-empty Packing slip Id (<code>PackingSlipId</code>).</p>

<p>While looking how to specify this in a query range, I found that it was possible to associate this query range to the <code>RecId</code> of the table. Is this the usual and classic way to do this ? See my example (which seem to work).</p>

<pre><code>   QueryBuildDataSource qbds;
   ;

   qbds =  this.query().dataSourceTable(tableNum(inventTrans));

   sysQuery::findOrCreateRange(qbds, fieldNum(InventTrans, RecId)).value(
    strfmt('(%1 != "") || (%2 != "")',
            fieldstr(InventTrans, Voucher),
            fieldstr(InventTrans, PackingSlipId)));
</code></pre>