Search This Blog

August 11, 2017

Microsoft Dynamics 365 for Finance and operations CookBook

Hi Friends,

It gives me an immense pleasure to share this your all, my another book has been released today on "Microsoft Dynamics 365 for Finance and operations" aka 'AX7'
Go and get your copy today...


Thanks for all your support. Enjoy….


July 13, 2017

One more year with MVP Award, Thank you!!!~

Hi Folks,

Its Party time!!!

But, First thing first.
A big thanks to all of you, for your faith, support during previous year.  It’s really a great feeling to get connect with you guys.


It’s just a coincident, today I reach to my 250th and I think it’s a perfect post to say thank and share this party with all of you.


Keep sharing you feedback and queries, Enjoy…

Deepak Agarwal aka Harry

Related Post:

Important links for Dynamics 365

Hi Folks,

Here are some important links that you check for your routine work, update, RnD, submit a suggestion and many more. 

PS: Photo taken from MS site.

July 11, 2017

How to use Form event ‘OnInitialized’ in Dynaics365

Hi Folk,

In Dynamics365 there are many standard events on Forms, similarly like standard methods on different node of form. Let’s see how we can use ‘OnInitialized’ event on Form Data source and use form object into a different call.

Scenario: On from ‘ProjAdjustmentSplit’ I want to enable/disable a field on certain condition. As D365 urge to not to customize ant standard object than write EventHandlers to achieve your requirement. In earlier version of AX, we simple write this logic either on Form Active method or from DS init method. Here we have to use EventHandlder for the same.  Here we will use ‘OnInitialized’ method and will write an eventHandler for the same.

Let’s take a look.

Approach: Follow below step to get this done,

Step 1: Right click on “OnInitialized’ method and select ‘Copy event handler method’


Step 2: Create a new class and paste this method.
/// <summary>
     /// </summary>
     /// <param name="sender"></param>
     /// <param name="e"></param>
     [FormDataSourceEventHandler(formDataSourceStr(ProjAdjustmentSplit, TmpProjAdjustmentSplit), FormDataSourceEventType::Initialized)]
     public static void TmpProjAdjustmentSplit_OnInitialized(FormDataSource sender, FormDataSourceEventArgs e)

Step 3: Use below code to access form object
TmpProjAdjustmentSplit      tmpProjAdjustmentSplit         = sender.cursor();
         FormDataSource              tmpProjAdjustmentSplit_ds      = sender.formRun().dataSource('TmpProjAdjustmentSplit');
         FormRun                     element                     = sender.formRun();
         FormControl                 projID;

Step 4: After above declaration now wrtie your actual business logic.
if(ProjParameters::find().myParameter== NoYes::Yes)
Step 5: Now go to
Project management and accounting > Periodic > Transactions > Adjust transactions and click on Adjust button to test your code.

Note: Try to add use the same code on your form and add more field using formConrol. Make sure you mark this control AutoDeclare = Yes on Form design.  Get complete code here.


May 23, 2017

How to enable ARM for D365 deployment

Hi Folks,

Many of us trying to deploy the new D365 environment using LCS and Azure, but due to ARM configuration we face below issue, 

Issue: Lifecycle Services can't connect to the Azure subscription using Azure Resource Manager. Click the Microsoft Azure Settings button and edit the selected Connector to provide the required permissions to ERP applications in your Azure subscription. If the issue persists, please contact support with this Id: da1c591d-7360-413c-b370-b51ec1ddef2b

Here are some good links on how we can fix this issue once for all, 

Hope this will help.

May 19, 2017

Breakpoint not hit in Visual studio [Dynamics 365]

Hi Folks,

Situation: While put a breakpoint and try to hit debug on any object which is not a part of your solution/project; Breakpoint will not hit. You will get below message.

“The breakpoint will not currently be hit. No symbols have been loaded for this document.”


Possible reason: This is because of one of Debugger property that will not load any symbols for other than Solution/Project objects.
Solution: To enable such debugging, you have to set the debugger property,
Uncheck this option Load symbols only for items in the solution as shown below snaps,

Step 1: Go to Dynamics 365 menu in Visual studio and select option


Step 2: Choose Debugging option from list and uncheck the Load symbols only for items in the solution


Now try to run again, this time breakpoint should hit as expected.



May 13, 2017

Send Message to all Online users [Dynamics 365 FO]

Hi Guys,

In D365 where we manage most of the things using LCS, if there is any Planned/Unplanned activity need to perform on server and down time require.
In such case, you need to send a message to all online used for that particular environment. To do that simply follow below steps,

Step 1: Login into your LCS account. 

Step 2: Under Environment section > select your environment. > Click on maintain option > Select Message online users.


Step 3: Here you will have two options
i.                    Broadcast a new message for downtime: Post a new message
ii.                 Cancel message: To cancel any previous posted message.


Step 4: Select Broadcast a new message for downtime, you have to provide message start date time and when this operation will begin OR massage valid to date time. click on Post button and click when asking for confirmation.


Step 5: When a user will login into environment he/she must get this message

Step 6: Now if in case you have to postpone or cancel this activity, choose second option i.e. Cancel message, system will ask which message you want to cancel as there can be multiple messages.

Let’s try to cancel first message that we created in last step. In the right corner, you will found a delete icon, click on that icon and hit yes when ask for confirmation. You will see now only two messages are active here


Now when user will login in next time he/she will not any notification from system.


May 06, 2017

Merger two LedgerDimension in Dynamics 365

Hi Folks,

In my previous post I shared  information about new classed that introduced in D365 for Dimension actions. In this post, I am sharing a sample code to merge two different ledger dimension and get a new LedgerDimension id.
This is rough code, please feel free to copy and update it according to your requirement.

public static void main(Args _args)
       LedgerJournalTrans  ledgerJournalTrans1, ledgerJournalTrans2 ;
       RefRecId            dim1, dim2, mergerDim;
       select firstonly TrvExpTrans where TrvExpTrans.ExpNumber == "USMF-000565";
       select firstonly AccountingDistribution where AccountingDistribution.SourceDocumentLine == SourceDocumentLine::find(TrvExpTrans.SourceDocumentLine).RecId;
       dim1 = TrvCostType::find("mycategory").LedgerDimension; //First dimension
       dim2 = 5637236123;//AccountingDistribution.LedgerDimension; //Second dimension
       mergerDim = LedgerDimensionFacade::serviceMergeLedgerDimensions(dim1, dim2);
      info(strFmt("Dim1: %1" , DimensionAttributeValueCombination::find(dim1).DisplayValue));
      info(strFmt("Dim2: %1" , DimensionAttributeValueCombination::find(dim2).DisplayValue));
      info(strFmt("merge dim: %1", DimensionAttributeValueCombination::find(mergerDim).DisplayValue));

Please share your queries/feedback in comment box, I will be happy to help you.


May 04, 2017

New classes in Dynamics 365 for Dimensions

Hi Folks,

Since many days, I was trying to perform few logics over LedgerDimensions and DefaultDimensions, like merge and replace etc. In AX2012 its handled by DiemsionDefaultingService class that having many static method to help us to play around ledger/default dimensions.

But in Dynamics 365 FO , this class is deprecated, and MS introduce few more classes to help us with these requirements. Here are few name of classes and method that can be used.

1. LedgerDimensionFacade : 
This class used for fixed LedgerDimension, we have many static methods here, like Merge Dimension, getdefaultDimension and many more, refer below image.


2. LedgerDimensionDefaultFacade: 
This class will help us to perform action over default dimension. Like Merge specify default dimension into single default dimension, replace attribute value etc.

Please refer below image, 


Both classed having almost same method that is available in AX with DiemsionDefaultingService class.

See Also,

How to merge two dimension


March 09, 2017

How to rename an Object in VisualStudio[Dynamics365/AX7]

Hi Folks,
Many times we need to duplicate an standard object and do the required changes and system gives warning while rename. Same caused error during project build.
 Problem: While renaming any object in Visual studio project system throw below warning
“Some of the files you are renaming or moving will be located outside of the project's binding root. The item(s) <objectName>.xml will not be source controlled if you continue with this rename.”
If you just continue with change , you may get errors while project/solution build.
Possible reason: If you are using TFS and this new object are not added to source code you’' will get this error.
Suggest Solution: Add this new object in Source control by right click on object and select “Add file  to source control”
Now you should be able to rename it.
This works for me perfectly. If you got some other solution to fix this issue plz keep share your feedback or links to other posts.

February 27, 2017

How to add Standard Address fields into a new table [Dynamics365/AX7]

Hi Folks,

Its been a long time to write any new post on AX. Here I’m back today. Since few months we all are trying the new Dynamics 365 and its amazing new features in D365.

In this post we will see how to add new address fields in table using Table mapping.

[Note: In D365 we have object extension functionality to customize standard objects. But we don't have this option for Maps. This post will also help you to understand the alternative for the same by using table Mapping section.]

Requirement: We need to add all standard address fields in table followed by adding a new tab for address in respective from.

Proposed solution: We can achieve this by adding a single field rather than add multiple fields in table. Perform below steps to get this done,

1. Add a new field in table, EDT type “LogisticsLocationRecId”, rename it  as “Location”.

2. Now add a new Foreign key relation for “LogisticPostalAddress”  table and set its property as below snap shot,


3. Add a new map in mapping node for “LogisticsLocationMap”. Map field to location.
Your table must looks like below


Now we done with table customization, now we need do some addition on Form.

4. Firstly, Add new DS in your form, Table : “LogisticsPostalAddress”, set “LinkType” as “OuterJoin” with your main DS (where we added our new field “Location”)

5. Add a new tab page into your design with DS “LogisticsPostalAddress”(make sure it will be as per your from pattern)


Set Menu item object for menu item button as below table
MenuItemButton MenuItem Object Name
NewAddress LogisticsPostalAddressNewCustBankAccount
EditAddress LogisticsPostalAddressEditCustBankAccoun
ClearAddress LogisticsPostalAddressClearCustBankAccou
MapButton LogisticsPostalAddressMap

6. Add below code
I. Form declation 
LogisticsPostalAddressFormHandler   addressController; 
II. Form init
public void init()

        addressController = LogisticsPostalAddressFormHandler::newParameters(<maintable>_ds,LogisticsPostalAddress_ds);
III. New global method
public LogisticsPostalAddressFormHandler getAddressController()
        return addressController;
IV. Active method of new DS (LogisticsPostalAddress)
public int active()
            int ret;
            ret = super();

            return ret;
7.Save all your changes, build project and run the Form. Your changes must looks like below,
New tab on from
while click on edit button you will get an dialog that contain all address fields.


You can make require changes and click on Ok button it will save your changes and on Form will show complete address  in a single field (LogisticsPostalAddress.address)

Hope it will help…, Please keep sharing your comments and feedback.