Posts

Showing posts from 2019

Timesheet periods have not been created for Employee

Recently i was trying to create timesheet record but was getting error "Timesheet periods have not been created for Employee". I have resolve this by performing following steps. 1. Goto Project Management and Accounting -> Setup -> Timesheets -> Timesheet period types. Select your Period Type and click on Generate Periods. Fill out the form and press OK. 2. Goto Human Resources -> Workers -> select your worker. 3. Goto Project Management tab and select Project Setup. Fill out the form select Period Type for which you just have generated periods. 4. Now you good to create timesheet record.  

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 UserConn

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

Could not load file or assembly 'Microsoft.Dynamics.BusinessConnectorNet' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Image
Recently we were developing web service that that perform CRUD operation on AX 2009. We use business connector dll for this task. When we deploy app on IIS we start getting following error. Could not load file or assembly 'Microsoft.Dynamics.BusinessConnectorNet' or one of its dependencies. An attempt was made to load a program with an incorrect format. Dynamics AX .NET Business Connector contains both managed code and unmanaged 32-bit x86 code and as such it cannot be loaded by a 64-bit application. We resolved our issue by enabling 32 bit application in IIS. 1. Go to IIS. 2. Select you application pool. 3. Click Advance setting. 4. Set Enable 32-Bit Application to true.