Showing posts with label Dynamics AX 2012. Show all posts
Showing posts with label Dynamics AX 2012. Show all posts

Monday, October 20, 2014

Show open windows in development view and switch between them

I just developed a simple form to show all open windows i development view. It has the following features:

  • Double-click an item to switch to the corresponding window.
  • Click "Close window" to close the selected window.
  • Auto-refreshes the view every 3 seconds.
  • Stays within the workspace (i.e. not "outside AX").
  • Stays open after switching windows (unlike the default Windows -> Windows)!
  • Works in both Dynamics AX 2009 and 2012.

It has greatly helped me manage my windows when developing...! :)

When imported, you should add a menu item pointing to the form (eg. in \Menus\GlobalToolsMenu on AX 2012).


Let me know if you need more features :)

Screenshot:



Thursday, September 1, 2011

Ax 2012 - Get dimensions

If you've been working with Dynamics AX 2012 dimensions, you'll know that they are pretty hard to understand and work until you get to know them. I finally figured out how to get the dimensions and dimension values through X++.

Get dimensions:

DimensionAttribute              dimAttr;
DimensionAttributeSetItem       dimAttrSetItem;
DimensionAttributeSetItem       dimAttrSetItemEditable;
DimensionEnumeration            dimensionSetId;
dimensionSetId = DimensionCache::getDimensionAttributeSetForLedger();
while select dimAttr
    order by Name
       where dimAttr.Type != DimensionAttributeType::MainAccount
        join RecId from dimAttrSetItem
       where dimAttrSetItem.DimensionAttribute == dimAttr.RecId &&
             dimAttrSetItem.DimensionAttributeSet == dimensionSetId
  outer join RecId from dimAttrSetItemEditable
       where !dimAttrSetItemEditable.DimensionAttributeSet &&
             dimAttrSetItemEditable.DimensionAttribute == dimAttr.RecId &&
             dimAttrSetItemEditable.EnumerationValue == NoYes::Yes
{
   info(dimAttr.Name);
}
Get dimension values for the "CostCenter" dimension:
Common common;
DimensionAttribute dimAttr;
select firstOnly dimAttr where dimAttr.Name == "CostCenter";
common = new DictTable(dimAttr.BackingEntityType).makeRecord();
while select common
{
    info(strFmt("%1", common.(dimAttr.NameAttribute)));
}