static void MainAccountDimension(Args _args)
{
LSVVendInvStageTmp LSVVendInvStageTmp;
MainAccountLegalEntity MainAccountLegalEntity;
MainAccount mainaccount;
CompanyInfo companyInfoList;
Ledger ledgerList;
MainAccountLegalEntity mainAccountLegalEntityList;
;
while select *from mainaccount
{
while select DataArea from companyInfoList
join RecId from ledgerList
where ledgerList.PrimaryForLegalEntity == companyInfoList.RecId &&
ledgerList.ChartOfAccounts == mainaccount.LedgerChartOfAccounts
notexists join RecId from mainAccountLegalEntityList
where mainAccountLegalEntityList.LegalEntity == companyInfoList.RecId &&
mainAccountLegalEntityList.MainAccount == mainaccount.RecId
{
MainAccountLegalEntity.clear();
MainAccountLegalEntity.MainAccount = mainaccount.RecId;
MainAccountLegalEntity.LegalEntity = companyInfoList.RecId;
MainAccountLegalEntity.DefaultDimension = 5637144576;
MainAccountLegalEntity.FixedDimensions = 0;
MainAccountLegalEntity.insert();
}
}
}
{
LSVVendInvStageTmp LSVVendInvStageTmp;
MainAccountLegalEntity MainAccountLegalEntity;
MainAccount mainaccount;
CompanyInfo companyInfoList;
Ledger ledgerList;
MainAccountLegalEntity mainAccountLegalEntityList;
;
while select *from mainaccount
{
while select DataArea from companyInfoList
join RecId from ledgerList
where ledgerList.PrimaryForLegalEntity == companyInfoList.RecId &&
ledgerList.ChartOfAccounts == mainaccount.LedgerChartOfAccounts
notexists join RecId from mainAccountLegalEntityList
where mainAccountLegalEntityList.LegalEntity == companyInfoList.RecId &&
mainAccountLegalEntityList.MainAccount == mainaccount.RecId
{
MainAccountLegalEntity.clear();
MainAccountLegalEntity.MainAccount = mainaccount.RecId;
MainAccountLegalEntity.LegalEntity = companyInfoList.RecId;
MainAccountLegalEntity.DefaultDimension = 5637144576;
MainAccountLegalEntity.FixedDimensions = 0;
MainAccountLegalEntity.insert();
}
}
}