I finally learned...A basic dimension is a default dimension. This is a value that concatenates a number of dimension values and is located in the Dimension Attribute Value Combination Table. If you add a Main Account, then you have a Ledger Dimension. The combination that you may try to retrieve or create MUST be part of the Main Account's Account Structure.
There are 2 approaches to getting a Ledger Dimension
1) Query it with AxdDimensionUtil::getLedgerAccountId
2) Create or retrieve it with DimensionDefaultingService::serviceCreateLedgerDimension
The code to retrieve a Ledger Dimension is:
private DimensionDefault getLedgerDimension(MainAccountNum _mainAccount, Num, str _bu, str _costcenter, str _dept)
{
DimensionDefault result = 0;
int position = 0;
int dimensionCount = 0;
container account;
account += [_mainAccountNum, _mainAccountNum, 0];
if(_bu)
{
account += ['BusinessUnit', _bu];
dimensionCount++;
}
if(_dept)
{
account += ['Department', _dept];
dimensionCount++;
}
if(_costcenter)
{
account += ['CostCenter', _costcenter];
dimensionCount++;
}
account = conPoke(account, 3, dimensionCount);
try
{
result = AxdDimensionUtil::getLedgerAccountId(account);
}
catch
{
return 0;
}
return result;
}
The code to called serviceCreateLedgerDimension requires a Main Account Number and Default Dimension:
private DimensionDefault getLedgerDimensionFromDefaultDimension(MainAccountNum _mainAccountNum, DimensionDefault _defaultDimension)
{
DimensionDefault result = 0;
DimensionDefault ledgerDimension;
container account = [_mainAccountNum,_mainAccountNum, 0];
ledgerDimension = AxdDimensionUtil::getLedgerAccountId(account);
result = DimensionDefaultingService::serviceCreateLedgerDimension(ledgerDimension, _defaultDimension);
return result;
}
Tuesday, March 19, 2019
Tuesday, March 12, 2019
D365 FO and External DLLs
We recently had to add some external dlls to our D365 for Finance and Operations model. We found out that when the references are added to a project, an XML descriptor of the reference is placed in $\LCS Dynamics Ax\Trunk\<your branch>\Metadata\<your model>\<your model>\AxReference. However, once you ready to deploy, the actual dll must be manually added to $\LCS Dynamics Ax\Trunk\<your branch>\Metadata\Bin. Otherwise, the LCS build will fail with a class not found error.
Subscribe to:
Posts (Atom)