Metod 1;
container conCompanies;
while select dataArea
where !dataArea.isVirtual
{
conCompanies += [dataArea.id];
}
while select crosscompany : conCompanies inventTable
{
// ... do something ...
}
metod 2;
public Query buildQuery()
{
Query query = new Query();
QueryBuildDataSource qbds;
DataArea dataArea;
;
query.allowCrossCompany(true);
while select dataArea
where !dataArea.isVirtual
{
query.addCompanyRange(dataArea.id);
}
qbds = query.addDataSource(tablenum(InventTable));
qbds.addRange(fieldnum(InventTable, ItemId));
qbds.addRange(fieldnum(InventTable, PrimaryVendorId));
return query;
}
metod 3;
DataArea dataArea;
;
while select dataArea
where !dataArea.isVirtual
{
changeCompany(dataArea.id)
{
// ... do something ...
}
}
container conCompanies;
while select dataArea
where !dataArea.isVirtual
{
conCompanies += [dataArea.id];
}
while select crosscompany : conCompanies inventTable
{
// ... do something ...
}
metod 2;
public Query buildQuery()
{
Query query = new Query();
QueryBuildDataSource qbds;
DataArea dataArea;
;
query.allowCrossCompany(true);
while select dataArea
where !dataArea.isVirtual
{
query.addCompanyRange(dataArea.id);
}
qbds = query.addDataSource(tablenum(InventTable));
qbds.addRange(fieldnum(InventTable, ItemId));
qbds.addRange(fieldnum(InventTable, PrimaryVendorId));
return query;
}
metod 3;
DataArea dataArea;
;
while select dataArea
where !dataArea.isVirtual
{
changeCompany(dataArea.id)
{
// ... do something ...
}
}