Wednesday, July 19, 2017

Main Account Dimension update

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();
        }
    }
}

No comments:

How to identify the user that was used to change an object from AOT in AX2012

Get the object name for which we need to track these (user and date&time) information's. Login to SQL Server Management Studio an...