Posts

Showing posts from February, 2014

Microsoft Dynamics Ax Table Method

Methods are used for adding X++ code to your application. The code in methods is also referred to as business logic. Whenever records are changed, inserted or deleted from a table various default methods are executed. We can change the default methods and by doing so we are overriding the default methods. To override a method go to the Methods node of a table, right click and choose Override Method. Below are few examples of Overriding commonly used Table methods: initValue(): If we create a new record from the table browser or a form the table method initValue() is executed. It is used to set a default value for the fields. Example (1): Let’s override intiValue for MyFirstTable and set default value for custGroupId public void initValue() { super(); this.custGroupId = "10"; } After adding this method, open table MyFirstTable  through Table browser and press ctrl+n to create a new record. The field custGroupId will now have the default value 10. modifiedField(...

Error " The CIL generator found errors and could not save the new assembly"

Image
On this post I would like to discuss how to solve the CIL compilation error when deploying services for the first time in AX 2012. I have been working on a newly installed AX 2012 CU2 instance this week, and I deployed both  basic  and  enhanced  services.  This action was successfully done and I did not experience any issues. However, when I created a new service group and I deployed it, I encounter an error saying “ The CIL generator found errors and could not save the new assembly ”.   Now, this instance of AX 2012 is using a restored DB backup from another instance as I needed some data and objects already existing. It makes sense to think that this issue is true from the premise that I never went through a full AX and CIL compilation.  In addition, when generating the services through the installation, the references to the .NET Module File and the AX Application DLL were correct, but where they referring to the correct .NET Assembly types f...

"NO DEVICE ERROR" when starting AX2012 / AX2009 Client

Hi All, We often see that  the infolog pops-up with an error message: 'No Device' This error message is displayed when opening the AX client with the Configuration Key  "Telephony Integration"  enabled. This error message is caused by the ActiveX component for the phone integration on form smmPhone which returns an error for each phone device which is offline. The solution to this error is disabling the Telephony Integration which we generally never use. Steps are as follows : Click  System administration  >  Setup  >  Licensing  >  License configuration . In the  License configuration  form, expand the  Sales and marketing series  node, and then UNSelect/Unmark   the  Telephony integration  check box. Click  Apply . Close AX Client and restart. !! No Infolog.

AX2012 R2 : X++ code to create and post Inventory Movement Journal

Below is X++ code which is good to keep handy. It can be used to create and post inventory movement journals in AX 2012 R2. I have use hard coded values for illustration purpose:         InventJournalTable              inventJournalTable;         InventJournalTrans              inventJournalTrans;         InventJournalNameId             inventJournalName;         InventDim                            inventDim;         JournalCheckPost               journalCheckPost;         //Below code creates journal header               inventJournalTable.clear();         inventJournalName =  InventJournalName:...

Debug::assert In MS Dynamics Axapta

This method allows to check if some Boolean condition evaluates to true and if it doesn't - stop further execution and show stack trace. Debug::assert() should be used to validate some assumptions made in the code which should never happen if nothing is broken in the application. It means that wrong user input should not be asserted but rather validated by normal if statement and exception should be thrown if the input is wrong. However, if the code relies, for example, on query data source name, which can be broken only in development time - that is a good place to add assert to. Example:     Query query = new Query(querystr(Alertsetup));     QueryBuildDataSource qbds;     ;     qbds = query.dataSourceName(identifierstr(EventRule));     Debug::assert(qbds != null);

interview Questions AX 2012

1. What’s new in Dynamics AX 2012 SSAS - Analysis service project wizard. AOS - Validfrom and validto columns, Unit of work class, Inheritance among the tables Client -Form styles, Search and parts EP - Sharepoint 2010, listpge famework, windows live authentication Morphe x - Models and model store, dev. workspace, some layers renamed and powershell SSRS – Labels in reports, auto reports, cross reference can access, unlimited dimensions X++ -Eventing, attributes, .Net proxies to X++ classes, faster compilition 2. What are the architecture changes done in AX 2012 R2? The model store and the transaction data are stored in separate OLTP databases. In other versions of Microsoft Dynamics AX 2012 prior to Microsoft Dynamics AX 2012 R2, the model store and transaction data are stored in a single OLTP. 3. What are Partitions? What is the purpose of partitions in Microsoft Dynamics AX 2012 R2? http://msdn.microsoft.com/en-us/library/jj677285.aspx 4. What are Models and Model st...

Restoring the Database with the SQL command

RESTORE DATABASE AXDB FROM DISK = ‘d:\test.bak’ WITH REPLACE

How to create a load balancing cluster [AX 2012]

We can distribute the user load in Microsoft Dynamics AX across multiple instances of Application Object Server (AOS) by creating a load balancing cluster. Microsoft Dynamics AX offers two types of load balancing clusters: 1.      A cluster that includes a load balancer  the load balancing AOS instance is dedicated to distributing the user load. And this load balancing AOS instance does not process MS DAX business logic or data. 2.      A cluster that does not include a load balancer you must set up client configurations to connect to the load balancing AOS instance. When a client starts, it connects to the load balancing AOS instance. The load balancing AOS instance returns a list of active AOS instances in the cluster, sorted by workload. The client attempts to connect to the first AOS instance in the list. If that connection fails, the client attempts to connect to the second AOS instance in the list, and so on. Before you can...

Top 10 issues discovered from Dynamics AX Health Check

A very informative blog post by  Bertrand Caillet  covering important points for Dynamics AX best practices for health check, and it contains a sub links under main points. I am glade to share it over my page. 1. Max Degree of Parallelism is not set to 1 2. No Pre-Allocation for Non Continuous Number Sequences with high consumption 3. Insufficient Auto Growth for Data and Log files 4. Processor bottleneck for Dynamics AX batch processing 5. Heavy Application database logging 6. Missing Clustered indexes 7. Wrong Index maintenance 8. Enabled debug in Production 9. Power Management set to Balanced 10. Kernel and Application are outdated and should be patched The Premier Field Engineer team has been running several hundred of  Dynamics AX Health Check  worldwide and I thought it would be interested to share the most common issues discovered during onsite. Some of the following issues might look trivial but the reality is that despite all the lit...

Working with models in AX 2012 :)

How to: Export and Import a Model AX 2012  Run:  enter: Cmd >> go to specified path C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin Type the following command: // creating the Model in the Layer AxUtil.exe  create /model:"Name" /Layer:CUS // exporting the model to file AxUtil.exe export /model:"NAME" /file:"NAme".axmodel // importing the model from file AxUtil.exe import /file:Name.axmodel  >>   /config:instanceName ( import to correct AOS) >> /createparents (in case of conflicting with system model) // delete the model AxUtil.exe delete /model:"Name " //delete the layer AxUtil.exe delete /layer:ISV // if you have multiple instances running //delete the layer from the database and AXserver. >>>>>   AxUtil.exe delete /layer:ISV /db: /s: How to deploy Dynamics AX2012 reports: Through AOT AOT > SSRS Reports > Reports > right ...

Sequence of methods in form and table in AX

Form: Sequence of Methods calls while opening the Form Form — init () Form — Datasource — init () Form — run () Form — Datasource — execute Query () Form — Datasource — active () Sequence of Methods calls while closing the Form Form — canClose () Form — close () Sequence of Methods calls while creating the record in the Form Form — Datasource — create () Form — Datasource — initValue () Table — initValue () Form — Datasource — active () Sequence of Method calls while saving the record in the Form Form — Datasource — ValidateWrite () Table — ValidateWrite () Form — Datasource — write () Table — insert () Sequence of Method calls while deleting the record in the Form Form — Datasource — validatedelete () Table — validatedelete () Table — delete () Form — Datasource — active () Sequence of Methods calls while modifying the fields in the Form Table — validateField () Table — modifiedField () Table: When you press...