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("MyDemoLedgerChartOfAccount");
dimensionServiceProvider = new DimensionServiceProvider();
dimensionServiceProvider.createMainAccount(mainAccountContract);
ttscommit;
hi,.. can i publish this post in my blog?
ReplyDeletesure
Deletehi, Raza.
ReplyDeleteis this DimensionServiceProvider.CreateMainAccount() only for create a new one?.. how about to update a mainaccount? ..can we use this class?