Posts

Showing posts from August, 2017

Dynamics AX 365 Create Main Account Using X++

DimensionServiceProvider class manages business logic for account. Following is the sample code how to create account using x++. DimensionServiceProvider dimensionServiceProvider; MainAccountContract mainAccountContract; MainAccountCategory mainAccountCategory; DimensionLedgerAccountType dimensionLedgerAccountType; ; ttsbegin; select firstonly mainAccountCategory where mainAccountCategory.AccountCategory == "CASH"; mainAccountContract = new MainAccountContract(); mainAccountContract.parmName("MyDemoAccount"); mainAccountContract.parmMainAccountId("0000001"); mainAccountContract.parmIsBlockedforManualEntry(NoYes::No); mainAccountContract.parmType(str2Enum(dimensionLedgerAccountType, "Balance sheet")); mainAccountContract.parmAccountCategoryRef(mainAccountCategory.AccountCategoryRef); mainAccountContract.parmLedgerChartOfAccounts("MyDemoLedgerChartOfAcco