Modify/ Update the Default Dimension in AX 2012 R3 Using X++ Code.
Modify/ Update the Default Dimension in AX 2012 R3 Using X++ Code.
static void RB_ModifyDimension(Args _args)
{
ItemId itemId;
str costCentre;
DimensionAttributeValueSetStorage dimStorage = new DimensionAttributeValueSetStorage();
DimensionAttribute dimAttribute;
DimensionAttributeValue dimAttributeValue;
DimensionDefault defaultDimension;
#define.CostCentre('CostCentre')
itemid = "TESTItem";
costCentre = '2000';
ttsBegin;
if (itemid && costCentre)
{
defaultDimension = InventTable::find(itemId).DefaultDimension;
dimStorage = DimensionAttributeValueSetStorage::find(defaultDimension);
dimAttribute = DimensionAttribute::findByName(#CostCentre);
dimAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimAttribute, costCentre, true, true);
dimStorage.addItem(dimAttributeValue);
// Dimension modified or updated including costcentre as well.
defaultDimension = dimStorage.save();
info(strFmt("Modified/ Updated Default Dimension %1", defaultDimension));
}
ttsCommit;
}
Subscribe to:
Post Comments (Atom)
D365 F&O Release Pipeline Step by Step Configuration Without ISV's
Step-by-Step Guide: Creating D365FO Build and Deploy Pipelines Azure DevOps Build Pipeline I will walk through the standard procedures...
-
X++ code to read the Excel file static void RB_ReadExcel(Args _args) { SysExcelApplication application; SysExcelWorkbooks w...
-
//Create a new job and paste the code static void RB_ReadTextFile(Args _args) { Filename ...
-
// If the file path comes from the dialog , it automatically works ,else you need to Specify '\\' --------------------------------...
No comments:
Post a Comment