Translate

Monday, September 28, 2015

AX2012- Opening an url form AX X++ code

Infolog.lookupurl("www.google.com");


this statement will quickly open google website in default browser.


Hope this helps,
Prasan

AX2012- Update/Change FinancialDimension value in X++ code

static void PSV_UpdateOpDivDimension_Items(Args _args)
{
InventTable inventTable;
DimensionAttributeValueSetStorage dimStorage;
DimensionAttribute dimAttrOpDiv;
DimensionAttributeValue dimAttributeValue;
changeCompany('DAT')
{
while select forUpdate inventTable
{
ttsBegin;
dimStorage = DimensionAttributeValueSetStorage::find(inventTable.DefaultDimension);
dimAttrOpDiv = DimensionAttribute::findByName("Operating_Division");

dimAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimAttrOpDiv, 'NewValue', true, true);

dimStorage.addItem(dimAttributeValue);
inventTable.DefaultDimension = dimStorage.save();
inventTable.doUpdate();
ttsCommit;
}
}
}


This code updates the items financial dimensions to new values.


hope this helps,
Thanks
Prasan