Posts

Showing posts with the label Dynamics AX 365

The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop

 While updating local server to platform update 39, I got below error. The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: System.Management.Automation.RuntimeException: An exception of type System.Net.WebException occurred when making an http request to: http://127.0.0.1/ReportServer. Refer to the log file for more details. Issue was resolved by just  Navigate to folder where your package is located, and right click on folder and uncheck Read-only, and click Apply. You will get pop-up asking to apply change to inner folders and files, select yes. Navigate to  C:\AosService\PackagesLocalDirectory location can be different depending on server. Find folder " SystemHealth ". and uncheck Read-only and click Apply. Re-run step where your update was failed.

The required assembly 'Microsoft.Dynamics.Framework.Tools.ApplicationExplorer.dll' does not exists.

 I was applying Platform update 10.0.14 to one of our internal server when I got this error. The required assembly 'Microsoft.Dynamics.Framework.Tools.ApplicationExplorer.dll' does not exists. To resolve this error I just copied dll to location on which it was throwing error and that's it. I rerun the step and my issue resolved. 

Dynamics AX Transaction scope and UserConnection class

We have done some customization in AX which perform insertion and updating data on multiple tables. It oftens fails and we have no clue where it fails so we decided to implement logging just for knowing how much steps are performed up till and if it fails where did we fails. We decided we will create separate table for logging and records every step in table which is about to performed so in this way we detail about steps. Normally we perform all activity in one transaction so if something fail whole process should be reverted but we want that our log should persists in table. There is a class UserConnection which exactly do what we wanted it to do. You just have to create its instance and on table just mention that it AX should use this new connection for this particular table. I am giving you an example.   static void SampleUserConnection_Job(Args _args) { VendTable vendtable; MyLogTable myLogTable; UserConnection userConnection = new User...

Dynamics 365 Error : Unable to resolve dependency dynamicsax-dimensionsformadaptor

We were removing over layering from our code and while creating deployment package we got this error "Unable to resolve dependency dynamicsax-dimensionsformadaptor". This error comes because we were not including some models. So what you have to do is to check model dependency hierarchy and see on which models have dependency. Just include those models in your deployment or remove reference of model from your model. To check model dependency hierarchy in AOT model view right click on model and  View Package Dependencies > View Incoming References. To remove model reference  go to Dynamics 365 > Model Management > Update Model Parameters select your model and uncheck model which you want to exclude.

D365 Enable/Disable maintenance mode for DEV and UAT

There are two ways you can enable maintenance mode. 1. COMMAND: To enable maintenance mode open command prompt as Admin and execute below command J:\AosService\PackagesLocalDirectory\Bin\Microsoft.Dynamics.AX.Deployment.Setup.exe --metadatadir J:\AosService\PackagesLocalDirectory --bindir J:\AosService\PackagesLocalDirectory\Bin --sqlserver . --sqldatabase axdb --sqluser axdbadmin --sqlpwd ********* --setupmode maintenancemode --isinmaintenancemode true' To disable maintenance mode open command prompt as Admin and execute below command J:\AosService\PackagesLocalDirectory\Bin\Microsoft.Dynamics.AX.Deployment.Setup.exe --metadatadir J:\AosService\PackagesLocalDirectory --bindir J:\AosService\PackagesLocalDirectory\Bin --sqlserver . --sqldatabase axdb --sqluser axdbadmin --sqlpwd ********* --setupmode maintenancemode --isinmaintenancemode false Make sure you give the correct path of AOS service directory. 2. SQL: To enable maintenance mode write below query on sql se...

Dynamics ax 365 display method

As we cannot create new method in exiting (Microsoft don't recommend overlayering) or extension table. We have to create extension class to add display method. First you have to create extension and add display method in it. public static class CustTable_Extension {   [SysClientCacheDataMethodAttribute(true)]   public static display str customerGroup(CustTable_this)  {     CustTable custTable;    select custTable    where custTable.AccountNum== _this.AccountNum;    return custTable.CustGroup;   } } To use this method in form you have to set DataMethod as CustTable_Extension::customerGroup and CacheDataMethod as YES.

Dynamics 365 : Breakpoint not hit in Visual studio

Image
Some time while development in Visual Studio and while debugging you receive message "The breakpoint will not currently be hit. No symbols have been loaded for this document." This issue can be resolved by following steps   1. From tool bar go to Dynamics 365 and select option   2. Choose Debugging option from list and uncheck the Load symbols only for items in the solution   Now try again.

Dynamics AX 365 : Create Role, Duties and Privilege From UI

Image
Dynamics 365 comes with lot of new features. One feature i like is the user now able to create new roles, duties and privilege directly from user interface. It does not mean you will not be able create them from AOT, you can create them from AOT as well. This feature is necessary if you using online version of Dynamics 365 because user does not have direct access of production AOT and every change required code promotion which is time consuming. Navigate to System Administrator -> Security -> Security Configuration  First create Privilege  I am creating Privilege for my custom report so i am selecting Output menu items then click on Add reference, new dialog will be opened select your menu item and set permission and click ok.  Repeat same steps for Duties and Roles that is to create or select existing duty/role click Add Reference to select Privilege for Duty or Duty for Role. When you are done with creating your custom role you have to Publish your...