Cross Company queries - X++
When we create a query in X++, it fetches record only for the company that we are logged in. If we want to get records for multiple companies, we have the keyword in X++. i.e. crossCompany. Select query: For example, Let’s say we write the following query. SalesTable salesTable; while select * from salesTable { i nfo(strfmt(“%1”,salesTable.SalesId)); } It will return only the records from the company we are logged into. Now we want to get records from all companies. We will need to write following query. while select crossCompany salesTable { info(strfmt(“%1”,salesTable.SalesId)); } This crossCompany keyword will return all the companies record. If we want to get specific companies records, we need to use container . For example, container specificComp = [‘USMF’,’USMR’]; while select crossCompany : specificComp salesTable { info...