Search This Blog

Thursday 30 May 2013

Adding Lookup with custom range on Forms In Microsoft Dynamics Ax 2012

Its quit easy in Microsoft Dynamics AX 2012 to create the lookups.

Lookups are basically the drop down list through which we are selecting the value and then setting the value behind that field.

You can see in the below image on what lookups are and how they work.


  In the above image when we click the add button or click the purpose field then the lookup is open.You can make these kind of lookups in your own forms.

Below are the steps for making the custom lookup with your define ranges.

 Step 1:

First on the form -> DataSource right click the field on which you are making the lookup and than select the override method lookupRefrence().

As you can see in the below image.














Now you can see whats inside that method.









Actually in the above code I am calling the another method that I write on the table level.Inside that method I have make the logic of the lookup.

In the below image you can see the logic of that method for making the lookup.









Basically in that Method I have made the query which fetches the record based on our criteria and than we make lookup on the based on the fetched data and than return it to the form.From where it was called.

That was all from my side related to the custom lookups.

I have also see a very good link related to the lookups.You can also check this.

Custom Lookups 

If you still have any questions related to the custom lookups than feel free to post it on my blog.

Thanks

Muhammad Zahid

Thursday 9 May 2013

Simple Use of Compile Forward In Microsoft Dynamics AX 2012

Some times when we modified the definition of the method like increasing or decreasing the number of parameters and than in other code when we call that method its gives us error like "wrong number of parameters or something like that"


As you can see that in the below image.











Now some times these errors are not belongs to your code.

To fix these kind of issues you just have to go to the class that contains the definition of the method that you are calling and than right click that class than click compile Forward.

as you can see in the image below.























Now after doing this the error will not come in your code that calling the method of that class.As you can see in the below image







By the help of Compile Forward we can resolve these kind of errors.

I hope you like my post.

Thanks

Muhammad Zahid.