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 X++ code Update_Recordset and SkipDataMethods still calling update method
D365 F&O X++ code Update_Recordset and SkipDataMethods still calling update method It sounds like you're encountering an issue where...
-
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 ...
-
// Create a job and paste the below code .. static void RB_validateEmail(Args _args) { Str email; Str MatchEmail...
No comments:
Post a Comment