Нашел решение, в init для DataSource пишем код:
X++:
public void init()
{
Query query = new Query();
QueryBuildDataSource wmsOrderTransQBDS, salesTableQBDS;
QueryRun queryRun;
QueryBuildRange qbr;
;
wmsOrderTransQBDS = query.addDataSource(tableNum(WMSOrderTrans));
salesTableQBDS = wmsOrderTransQBDS.addDataSource(tableNum(SalesTable));
salesTableQBDS.addRange(fieldnum(SalesTable, asu_SOType)).value(enum2str(asu_SOType::AccessoryOnly));
salesTableQBDS.addLink(fieldNum(WMSOrderTrans, inventTransRefId), fieldNum(SalesTable, SalesId));
salesTableQBDS.fetchMode(QueryFetchMode::One2One);
wmsOrderTrans_ds.query(query);
super();
}
Спасибо за совет