Sunday 1 November 2015

Use of Crosscompany to get Data from other companies using X++ [AX 2012]

Hi,

Use of Crosscompany to get Data from other companies.
Today I am explaining how to use Crosscompany in your code.....

Example 1.
static void CrossCompany_example(Args _args)
{
InventTable inventTable;

While select crosscompany * from inventTable

{

info( inventTable.ItemId + " : " + inventTable.NameAlias + " : " + InventTable.dataAreaId);

}

}


Example 2.
static void CrossCompany_example(Args _args)
{
InventTable     inventTable;
container conCompanies = [ 'USRT', 'USSI' ]; // you can assign selected companies
str comp;
;

while select crossCompany : conCompanies * from inventTable
{
info( inventTable.ItemId + " : " + inventTable.NameAlias + " : " + InventTable.dataAreaId);
}

}

For more click  here

Happy DAXing :-)

No comments:

Post a Comment

Import General journal from excel in D365 F&O

 Hi Guys, Import General journal from excel in D365 F&O Code:  using System.IO; using OfficeOpenXml; using OfficeOpenXml.ExcelPackage; u...