This is a good example to know how to use change company method to get data from multiple companies.
CustTable CustTable;
;
changecompany('dt1')
{
CustTable = null;
select firstonly CustTable;
info(CustTable.Name);
}
changecompany('dt2')
{
CustTable = null;
select firstonly CustTable;
info(CustTable.Name);
}