Job to Create N number of companys and import the data in it.
static void CreateCompanies_Rajiv(Args _args)
{
DataArea dataarea;
counter i;
CompanyDomainList companyDomainList;
CompanyDomainList cCompanyDomainList;
sysdataImport sysDataimport;
Application gappl = new Application();
filename filename;
;
filename = "D:\\MyShare\\Data\\5.0SP1\\ExtendedData\\40ExtendedData1380";
for(i=1 ; i<301 ; i++)
{
DataArea.clear();
DataArea.Id = 'C' + int2str(i);
DataArea.name = 'Company' + int2str(i);
DataArea.insert();
xDataArea::insertPost(dataArea);
while select * from companyDomainList where companyDomainList.CompanyId == DataArea.Id
{
select firstonly cCompanyDomainList
where cCompanyDomainList.CompanyId == DataArea.Id &&
cCompanyDomainList.DomainId == companyDomainList.DomainId;
if (!cCompanyDomainList)
{
cCompanyDomainList.data(companyDomainList.data());
cCompanyDomainList.CompanyId = DataArea.Id;
cCompanyDomainList.insert();
}
//create the default company
gappl.setDefaultCompany(DataArea.Id,false);
syssecurity::reload(false);
InfoLog.navPane().loadStartupButtons();
Infolog.navPane().refreshFavorites(infolog.navPane().selectedFavoriteGroup(),xInfo::currentWorkspaceNum());
sysDataImport = new sysDataImport();
sysDataImport.parmDropCompany(true);
sysdataimport.parmDeleteTables(connull());
sysDataImport.parmSilent(true);
sysdataImport.parmFilename(filename);
sysDataImport.parmServerAccess(Noyes::Yes);
sysdataImport.run(false);
//sysDataImport::importFile("D:\\MyShare\\Data\\5.0SP1\\ExtendedData\\40ExtendedData1380.dat",FileType::Binary);
}
if(i==14 || i==25 || i==40 || i==60 || i==75 || i== 90 || i== 110 || i== 130 ||
i==150 || i==170 || i==190 || i==220 || i==240 || i==270)
infolog.clearBrowser();
}
}
This Blog contains information regarding Dynamics AX 365 Finance and Operations AX (Axapta) Development and code that is frequently used. You can post any type of Queries related X++,EP, SSRS and AIF.
Subscribe to:
Post Comments (Atom)
Import and Export file from BLOB storage Account(Azure) in D365 F&O using X++
Import and Export file from BLOB storage Account in D365 F&O using X++ Import: /// <summary> /// MKInventQualityOrderLineService...
-
In the below example we will see how we can get the default financial dimension values from Purch line table. Here we are using AxdDimensi...
-
It is very common to use Like Operator in SQL SELECT column1, column2, ... FROM table_name WHERE columnN LIKE pattern ; N...
-
Get temp data from class to form Data source AX 2012 + X++ In the below example we will see how we can use the temporary table as form da...
No comments:
Post a Comment