Sunday, July 29, 2012

How to get onhand inventory?

A very common practice for a developer on day to day basis is to get on hand inventory based on different parameters (dimensions). I’ve came across a situation where I was getting this physical available from ‘InventSum’ table directly rather using ‘InventOnhand’ class and the result was different for some items. I think it would be better to use the InventOnHand class for querying on hand data. AX uses a secondary table called ‘InventSumDelta’ for capturing changes applied to the ‘inventSum’ that haven’t been committed yet. Not taking the ‘InventSumDelta’ in consideration can lead to unexpected results.
Here is the sample code snippet you can use for this purpose

Sunday, March 4, 2012

Data Import: Using Excel Add-in


While looking up some issues in data import functionality of Dynamics AX 2012, I came across an extremely useful blog. This blog is being maintained by Alex Anikiev. You will find a series of blog posts on importing data into AX 2012 using the Excel add-ins. He listed all the steps necessary to fix issues you might face when using Excel add-in.

I myself found this blog really very helpfull in getting understanding and resolving my issues.

Following articles can be of common interest when loading beginning balances.

Monday, January 30, 2012

Label files (Import and Delete) In Dynamics AX 2012

Today, I’m going to explore how can we import and delete label files in Dynamics AX 2012. Labels are no longer a file system like we had in 2009. We now have a new node in AOT - Label Files
To import labels that is exported from some other system right click on the Label Files node and select Create from File. Browse and select your .ald file. Once you select the file and hit OK, a new node is added under the Label Files node corresponding to the label file imported.
The amazing thing in 2012 is that you don’t need to restart AOS to re-build index files that we were doing in AX 2009. Just try using the label somewhere and you will see that it is immediately referenced.

If you search in your application folder, you won’t find the label file there. The application folder is located here
C:\Program Files\Microsoft DynamicsAX\60\Server\MicrosoftDynamicsAX\bin\Application\Appl\Standard

In Dynamics AX 2012, the label file is imported in your current model.

One of the important things to note is that if you right click on your label file you will not see a delete/remove option. In order to delete label file we have to transfer this file to a temporary Model and then we will delete the model by stopping AOS. Let’s do step by step



When you open AX now, you will get a dialog saying that "Your model store has been modified." This is normal because each time you perform an operation on a model, you will get this dialog. Depending on your operation, you should select one of the options. Since we just deleted a model which just had a label file, select Skip.
Open AOT and notice that the label file is deleted now.

Tuesday, January 17, 2012

Filter Dynamics AX lookup on EP 2012


Today, I came accross a requirement to filter AX lookup in EP 2012. I am making a web control where i need to display filtered lookup. I was thinking to modify performFormLookup() method on dataset datsource field. However, it didn't work.

The trick is to override datasetLookup() on Dataset > data source > field > methods. You will not find this method in the list of override methods so just create this as new method.





Monday, January 16, 2012

SSRS report in EP based on user selection

In this post, I will be explaining how to display SSRS report to Enterprise portal based on user input. The example which we will be following has a scenario to display pay slip report for each employee. The requirement can be that each employee should see his pay slip for any month based on selection. It means we have to pass two parameters i.e. the user logged in and the date he selected for the pay slip or with one parameter to filter query based on worker logged in.

To achieve this we have to do following steps

1.      Create SSRS report using data provider class and deploy it on server .

2.      Create DataContractor class to add a parameter which implements  SysOperationInitializable and SysOperationValidatable interfaces.

3.      Create a data provider class which will be filling temporary table on the basis of parameters passed through contractor class.

4.      Create a EP page which contains date calendar and a reportviewer control. We will be rendering report based on selected date.
[Note: Code written for classes is just for reference. It depends on the table and query as per your criteria. I am simply pasting code which is specific for my case. Do modify it as per your AOT structure.]

Now let’s see the detail.


Contractor class:


Data Provider class:




Now this is what we required to do in Dynamics AX. Let’s just see the modifications required on Visual studio EP project.
Web Control:


Add a web control to an EP project and then add following two controls

·         Calendar

·         AXReportViewer


 
Now, to render the report we will set the user selected date and on the event of selection change we will render the report as shown


I hope you will find this post helpful. In case of any question or help in this regard you are welcome.

Happy Daxing J

Tuesday, January 10, 2012

EP Development in Dynamics AX 2012

Enterprise Portal is a combination of several standard Microsoft technologies that extend a similar user interface to that available in the Microsoft Dynamics AX 2012 client.
Till AX 2009, developing an application/form for EP was not that much simple. Along with some other enhanced features introduced in 2012, Microsoft has made a tremandous change in this area as well.
For an example, If you made a List page form in Dynamics AX client then you can easily deploy this form on Web with just one click.

Recently, I developed my new module on EP and have developed a leave request form for the employee that is enabled for Workflow as well. I found the following video very helpfull. This is basically an internal training given by one of my friend named Zeeshan Jafery. 
http://vimeo.com/26902748

Saturday, January 7, 2012

Links for Dynamics AX 2012 Learning material

Many a times we are looking for some comprehensive materials. I also came accross a site which contains some important learning material and links for Dynamics AX 2012.

I hope you guys will find these link very usefull

http://daxmusings.blogspot.com/p/microsoft-dynamics-ax-2012-developer.html
http://www.loganconsulting.com/Library/MicrosoftDynamicsAXLibrary.aspx

Happy daxing :)

Reports Upgradation for 2012

One of the major change in Dynamics AX 2012 is related to reporting services. Though we were able to develop some SSRS reports in AX 2009 as well with limitted framework functionality. However, in AX 2012 SSRS reporting framework is much more enhanced. Currently, you can import your AX traditional reports of MorphX in 2012 with no change. However, you cannot develop new MorphX reports in 2012. So this is the right time to move all your MorphX reports to SSRS as in future releases of AX MorphX framework will be completey removed.

In order to migrate AX reports to SSRS report following are some important points
  1. Create a new query and make exactly the same query used in X++ report.
  2. Move all your business logic to RDP (Report data provider) class.
  3. AutoDesign reports of X++ will be replaced by AutoDesign in SSRS reports.
  4. Generated Design on X++ report will be replaced by PrecisionDesign in SSRS reports.
I would also like to share a blog reading on this topic
http://dynamics-ax.blogspot.com/2011/11/upgrading-reports-for-ax-2012-resources.html