≡ Menu

We can set credit limit for customer. Customer can purchase product or services up to certain limit. Even D365 for finance and operations provide us option to generate error message and stop processing of Sale order or just show error message and let the transaction happened.


For this you have to enable customer credit limit option from Account Receivable => step up => Account Receivable parameters.






In Account receivable parameter form, you  can found Credit limit option in Credit Rating  menu



If you explore Credit limit type you find following options


On selecting None, which is default means, credit limit functionality is disabled. Balance means, credit limit check against

Customer current balance, Next option is balance plus amount generated against packing slip and Product Receipt.

Third option is Balance + all include Packing slip, sale order and transaction activities.




Next option is when message exceeding the limit


We find one more option is on this page. This option is either apply credit limit on free text Invoice on .


Now we can set credit limit on Customer page, For this open required Customer and form detail page you can update credit limit. You can find Credit limit in Credit and collections fast tab



For more detail explore following link:





Book is excellent. It is handy and cover the almost all technical scenarios with very simple and precise examples. It is scenario based book, Instead a lot of story and unnecessary details, It focus to the point. As compare to previous cook books, which were more abstract, this feel book wrote in mind of fresh graduates or new developers in Dynamics Ax / Dynamics 365 for finance and operations.  After reading book, I feel it is like jigsaw puzzle, you can create a full customization by arrange piece by piece if you have this book. It contains everything which I come across in my 5 years’ experience for Dynamics.


Followings are chapters and my review.


Processing Data:


This chapter covers from creating new model, project in visual studio to complex Sql query execution.  Here you can find, creating a new sequence number, rename primary key, use regular table as temporary table. How to create query object at run time. And how to execute SQL Query directly in X++ code.

My favorite recipe here is ” How to use regular table as temporary table”.


Working with Forms

This chapter gives us very basics of Dynamics 365 for finance and operations forms. Very precise examples for day to day  scenarios.  These recipes contains how to make dialog, tips on catching dialog events, building dynamic form, creating a model form, storing the last values in form. Tree view control, Adding a view detail link. Also good detail of Dynamics form Patterns in Dynamics 365 for finance and operations.


My favorite recipe here is ” Storing Last values in form “.



Working with Data in Forms

This chapter covers the recipes for data manipulations in forms.  It covers sequence number handling, creating custom filter controls. Building a selected  or available list. Processing multiple record, Coloring the records, adding images to different record.

My favorite recipe is ” coloring the records “;



Building Lookups


This chapter covers the lookups based on different scenario, I found all are practical example for building Lookups


Processing Business Tasks.

This chapter is amazing. Containing everything you need to customize. You will find here, segment entry control, creating and posting general entry posting with X++ code, processing of Project ledger,  creating and posting of ledger voucher, creating Sales order, purchase order and electronic payment format.



Data Management

This chapter provide recipes of data migration for example,  data entities, data entities with multiple sources, Data packages, import export and trouble shooting.



Integration with Microsoft Office.


This chapter covers the integration with Excel and word using add-in, workbook designer, custom ax lookup in excel. And creating word document with repeated elements.



Integration with Power BI.

This chapter is also good, recipe for Dynamics 365 for finance and operations starts with Configuring Power BI, consuming data in Excel, Integration with excel, developing interactive Dashboards, embedding Power BI visuals.


Integration with services.


Couple of years back, I was integration expert, I did a lot of integration. This chapter is favorite for me. I was never be good designer, So services attract me more. Just write, consume, map fields schedule and run. I still do integrations of dynamics with. Even with devices like thumb recognition and attendance machines available locally with HR and Payroll.


This chapter contains the recipes

Custom service development, authentication with native client also with Azure. Consuming services in Json and soap. You can also find about Odata services. And also consuming external web services in Dynamics 365 for finance and operations.



Improving development efficiency and performance.


This chapter name seems not right, noting about performance here. It feels what left is placed here, Still recipes are valid and from practical day to day development / customization scenarios. Like extensions, display methods, calculate code execution time, enhance insert, delete and update time. Writing efficient SQL Queries. Event handler and delegate handlers.



I recommend you to read this book.




I found very interesting video regarding UI tips for Dynamics 365 for finance and operations. Its worth to share so it is here



Today I face the very strange behavior of X++ code.

We develop customization. We generate transfer and issuance through X++.

Logic was very simple,If stock is available then transfer  / Issuance or Adjustment journal create otherwise generate error message, We took this decision  based of query on Inventsum. It works fine in most of cases but In one case when stock is zero it fails. We create Movement Journal to generate stock in that Item variant.  The select query always return Zero stock in posted quantity. Even I get the recid in debug mode and placed in table explorer, Quantity is available in table explore.

This case occurs when got Zero stock in Inventsum table and we try to increase stock by movement journal, other wise select on InventSum works fine.


The query will be very similar


Select * from InventSum where Inventsum.ItemId == line.ItemId && inventSum.invetdimId == line.fromInventiDimId;


This will not work. Even Db synch, Inc Cil, Cache clear done, even Restart the Test server AOS.


I have to switch code from select query to Class InventOnhand. Very similar to following.


InventOnHand inventOnhand

InventDim       InventDim;

InventDimParm inventDimParm;




inventOnHand = InventOnhand::newParameters(_line.Itemid,_line.FromInventDimId,inventDimParm);


If (inventOnHand.availPhysical() > _line.RequestedQty)


Info( ” Quantity Avalible “);




Info (” Not available “);



Its works perfectly fine. I think  InventonHand class is better the do direct query on Inventsum table.



I one of last post, I added the custom financial dimension in D365 for finance and operations.
You can find this post here

In next post I load financial dimension in custom lookup.

Custom lookup for Financial Dimension D365 for Finance and Operations (Dynamics Ax 7)

But above link shows only out of the box financial dimensions. But what about custom financial dimension,

I tested the following code snippet works custom dimension. It load custom dimension mentioned in

Custom Financial Dimension in Dynamics 365 for Finance and Operations (AX 7)

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

SysTableLookup sysTableLookup;
Query query;
QueryBuildDataSource qbdsDimensionFinancialTag;
QueryBuildRange qbrFinancialTagCategory;
String20 LC;
RecId _recid;
DimensionAttribute _attribute;
Name _name=’jaggah_tax’;

// super();

// select * from attribute where attribute.Name ==_name;
// recid = attribute.financialTagCategory();

query = new Query();
qbdsDimensionFinancialTag = query.addDataSource(tableNum(DimensionFinancialTag));
qbrFinancialTagCategory = qbdsDimensionFinancialTag.addRange(fieldNum(DimensionFinancialTag, FinancialTagCategory));
qbrFinancialTagCategory.value(strFmt(‘%1’, DimensionAttribute::findByName(_name, false).financialTagCategory()));

sysTableLookup = sysTableLookup::newParameters(tableNum(DimensionFinancialTag), sender,true);
sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Value), true);
sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Description));
sysTableLookup.addSelectionField(fieldNum(DimensionFinancialTag, FinancialTagCategory));


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


Output is here


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.