≡ Menu

I just completed first video. 9 minute video just explore the navigation of D365 for finance and operations.

Dynamics 365 For Finance And Operations On Perm Demo from alirazazaidi on Vimeo.


Suppose we have to display all values in “Cost Center” financial dimension in custom lookup. For this post I used unbound field.

So first step is we need we need a text box. So drop a control of type “String” ( “Traditionally it is StringEdit Control”).

Right click on “OnLookup” event and click on “copy event handler method”.

Now add a new class in project, update its same as required. For this post I renamed it as FromControlEventHandler

Between opening closing brackets of class, paste the event code, I copied code in previous step.

[FormControlEventHandler(formControlStr(FrmTestDetail, FormStringControl1), FormControlEventType::Lookup)]
public static void FormStringControl1_OnLookup(FormControl sender, FormControlEventArgs e)


Later update event method with following code snippet, If you are seasonal Ax consultant or developer you will find this very similar to Ax 2012.

/// [FormControlEventHandler(formControlStr(FrmTestDetail, FormStringControl1), FormControlEventType::Lookup)]
public static void FormStringControl1_OnLookup(FormControl sender, FormControlEventArgs e)
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange qbrForAccount;
SysTableLookup sysTableLookup;
// DimType dimType;
DimensionAttribute dimensionAttribute;
// SysTableLookup::newParameters(tableNum(CustTable),sender);
sysTableLookup = SysTableLookup::newParameters(tableNum(OMOperatingUnit),sender,true);
sysTableLookup.addLookupfield(fieldNum(OMOperatingUnit, OMOperatingUnitNumber));
sysTableLookup.addLookupfield(fieldNum(OMOperatingUnit, Name));
queryBuildDataSource = query.addDataSource(tableNum(OMOperatingUnit));
queryBuildDataSource.addRange(fieldNum(OMOperatingUnit, OMOperatingUnitType)).value(int2str(any2int(OMOperatingUnitType::OMCostCenter)));

FormControlCancelableSuperEventArgs ce = e as FormControlCancelableSuperEventArgs;
//cancel super() to prevent error.


There is no need to add different classes for each event. You can copy and write events of different controls in single class.
There is another option on form control event, “Find Event Handler”. On click on it, will leads to event handler reference, I we wrote it. For current post I clicked on “Find Event handler”

results in as

Now let see what will our output. So I pressed Ctrl+F5 to form run without debugging.
Cheers, After pressing Edit Button my unbound custom lookup with Specific financial dimension works fine.


Testing the old code in Dynamics 365 for Finance and operations. It works fine. If you try to get all active financial dimension in D365 for Finance and operations following code snippet works perfectly fine.

class TestReadFinanicalDimension

/// Runs the class with the specified arguments.

/// The specified arguments. public static void main(Args _args)
DimensionAttributeSetItem dimAttrItemSet;
DimensionAttribute dimAttrList;
DimensionEnumeration dimensionSetId;

int dimAttrCount;

dimensionSetId = DimensionCache::getDimensionAttributeSetForLedger();

select count(RecId) from dimAttr
where dimAttr.Type != DimensionAttributeType::MainAccount
join RecId from dimAttrSetItem
where dimAttrSetItem.DimensionAttribute == dimAttr.RecId &&
dimAttrSetItem.DimensionAttributeSet == dimensionSetId;

info(strFmt(“Total active financial dimensions for current legal entity: %1”, dimAttr.RecId));

while select * from dimAttr
order by Name
where dimAttr.Type != DimensionAttributeType::MainAccount
join RecId from dimAttrSetItem
where dimAttrSetItem.DimensionAttribute == dimAttr.RecId &&
dimAttrSetItem.DimensionAttributeSet == dimensionSetId



Output is

Reference: https://sumitsaxfactor.wordpress.com/2011/12/14/find-active-dimensions-for-a-legal-entity-ax2012/


Purpose of this post to share the procedure I learned yesterday for adding custom Financial dimension in Dynamics 365 for Finance and Operations aka (AX 7). So I added a fictional Financial dimension.

Suppose we have to create a financial dimension with “Jaggah Tax”. This financial dimension required in Sales order, Sales Line, Purchase Order, Purchase line.


New Custom financial can be added and activate by following steps.



First of all open Ax in browser and change its legal entity to USMF.

Now click on General Ledger ==> Charts of Accounts ==> Dimensions => Financial Dimensions.





From financial dimensions page Click on New button. As a result detail page open in new / create mode.


You will find here three editable controls. From Used value drop down, select custom dimension, in second text box type name of dimension and in third text box type Report column Name.





Now click on Activate button from top menu.


On pressing Activating menu button, on right hand side a popup dialog opens. You can select different options from here. I want to activate this financial dimension so I selected activate now option.


So progress dialog show activation is under progress.


Finally we created a new financial dimension.


Now next step is to add values for dimension. Suppose our organization pay two types of jaggah tax.

-Noori Naath

-Mola Jatt.



So for this click on Dimension values menu button after selecting dimension open in detail section.


Click on New and enter values as much as requires. With each value also add  activation date.




We successfully create custom financial dimension. But until we add financial dimension in accounting structure  it will not available for selection.


For this again open General Ledger => Setup => Ledger



From Ledger detail form, select Manufacturing P&L. either double click on it or after selection click on edit button.




Account Structure is open, Also click on add  segment.



On right side a pop up opens with all financial dimensions. You can select required dimension.

From right side a pop up opens from there you can select required Dimension.



After selection Accounting structure look a like below screenshot.



Now on update financial dimensions values below text boxes in grid to “”;*. By default it will be *. Which means value is required.  “”;*. Means empty value or null values also allow in dimension.

Now update top value and activate it.

Activation in progress.


Now open Purchase order and from Header view, select newly added financial dimension.


Values are available here.



Our newly add financial dimension successfully added





A month ago, Microsoft publish a link page for  On-premises deployment.

They titled it as Landing Page.

This page contains On premise infrastructure, hardware requirements, licensing polices,  purchasing license, configuration, deployment and much more. Page is worth reading, you can find its detail from link below.




There is again small tips. Let me share you again scenario. Suppose you have to show customer Sale With customer group level. And group footer want to sum of Sales of that group. Now requirement is that customer with certain sub classification will skip in group sum. For example those customer who are on hold or blocked will not shown in report group sum, but shown in report detail

I was developing RDP based reports. So I add a int field in table. So I can mark specific record need to skip at group level sum.

I update the following SSRS expression to skip certain records at group level.

=Sum(iif(Fields!Flag.Value= 0, Cdbl(Fields!Value.Value), 0.0),”Group Name”)


Today I have small tip. Let me share a scenario. Suppose you have to display Customer group as report level group and customer at detail level who did purchased products from your organization in given period of time.

Serial number on detail level can be achieved by RowNumber(“Scope Name”)

But serial number shown on Group level is tricky because RowNumber not works there. For example in above mention scenario, Client wants serial number on Customer Group instead of Customer at detail level.

I used following single line SSRS expression helps me to achieve this.



Let me share you a small tip, During customization We extend out of box Enum for classification. Later client requirement is extensive usage of new Values for classification. For adding new values in enum results dependency on technical person . So we did customization and provide form and custom table so he can create number of values as he want. But now next challenge was, copy enum values and labels in Custom table, So He can use these value instead create again. I used following code snippet to copy data from Enum and insert into Custom table. Hopes this helps.


EnumId   enumId   = enumNum(LedgerPostingType);

DictEnum dictEnum = new DictEnum(enumId);

int      _NoOfValueInEnum = dictEnum.values();

int      counter;

CustomTable  _header;

delete_from _header;

for(counter = 0; counter < _NoOfValueInEnum; counter ++)


_header.ReportHeaderCode = dictEnum.index2Label(counter);

_header.Description = dictEnum.index2Label(counter);


_header.EnumValue = dictEnum.index2Value(counter);




Microsoft just release the white paper about system requirement of Dynamics 365 for Finance and Operations and Enterprise edition In short Dynamics Ax 7 on premises.


You can download it from here


Recently I complete the custom Inquiry for Dynamics Ax 2012 R3. That customization is extensive and based on Tree control. Now I did experiment with Tree view control  in Dynamics 365 for operation and output will share here.  For this post I used Dynamics 365 for Operation Update 4 Vm with contoso data.

Suppose we need to build tree Where Sale order Number came as parent and Customer account is as its child node. There is thousand possibilities, but I use simplest way. So first step to add form. Then add tree control it. Set Form Name and Auto declaration property to true. So we can access control in code behind.


Next step is to insert following code snippet initial method.



public class frmTreeViewTest extends FormRun


/// <summary>


/// </summary>

public void init()


SalesTable _Table;

TreeItemIdx _TreeItemid;







while select * from _Table


// _TreeItemid = SysFormTreeControl::addTreeItem(MyTreeView, _Table.SalesId + " : " + _Table.CustAccount ,FormTreeAdd::Root,  _Table.RecId);


_TreeItemid = SysFormTreeControl::addTreeItem(MyTreeView, "Sales Order :" + _Table.SalesId ,FormTreeAdd::Root,  _Table.RecId);

SysFormTreeControl::addTreeItem(MyTreeView, " Customer Account : " + _Table.CustAccount ,_TreeItemid ,  _Table.RecId);











Its works for me.




For rest Limit is only sky. Happy development.