Posts Tagged ‘Forms’

Drop Dialog Form in Dynamics Ax 2012

July 25, 2012 Leave a comment

In Ax 2012 there are many new form templates available. One of them i have widely used in my designs is the drop dialog. The drop dialog is very catchy little Form template that can create non intrusive UI for small updates/changes/inputs.

Here is a small picture of how a drop dialog will show up. (click on the image to open a gif Animation of the drop dialog)


In the standard you can find many places where the drop dialog boxes is put to use. The create planned order form in Master planning\Planned order is one nice example.

How to create a drop dialog button

1. Create a form from the Drop Dialog template

2. Create a menu item for this form

3. Add a “Drop Dialog button” in the form where you want to invoke it.

You are done with this beautiful little form:)

Creating Edit methods for DS that don’t allow editing in Dynamics ax – Followup

March 9, 2011 Leave a comment

A while ago i made a post on allowing a edit method to work on a disabled datasource ..

I found a still better idea from one of the comments, this post is to highlight the comment.

I rather would loop trough all data source fields (FormDataObject) and set them allowEdit=false at initalization time of the form/ds. That’s more confortable for the user, because he sees, that he cannot modify other fields than the edit fields. – 

One suggestion that i would add along to this is creating a SysHelper class for this, in case you find this recurring. You can just pass the record or datasource and the method will disable all the fields.

public class SysDictTable extends DictTable implements SysDictXmlReflectionProvider, SysDictXmlDocumentationProvider
    public static void disableDSfields(FormDataSource _fds)
        SysDictTable dictTable;
        int          i;

        dictTable = new SysDictTable(_fds.table());

        for (i = 1; i <= dictTable.fieldCntWithoutSys(); i++)

Creating Edit methods for DS that don’t allow editing in Dynamics ax

December 30, 2010 1 comment

Let’s say we have a Datasource and it is being displayed in the grid. The user has to choose one of it to further proceed. The use case is that you must be able to use a checkbox to select the records but you should not be able to modify rest of the information.

Technical implementation:
First Thought: Set allow create, allow delete allow edit property on the ds as false. Consequence: when you set allow edit as false you will no more be able to edit the checkbox also which is undesired.
Second Thought: Set allowedit false control wise either in the ds or in the formcontrol. Consequence: Too much work/customization. If done at formcontrol level the user can even add a field through
the syssteupform and start editing it (Refer here for details:

Best Approach: Set allow edit to true in the ds 🙂 . Override the write method in the ds and comment the super. Consequence: Peaceful solution 😉

public void write()


[tweetmeme source=”casperkamal” only_single=false]

set field control at the lowest possible level in Dynamics Ax

December 28, 2010 1 comment

When customizations are done with request to disable fields from editing the preferred approach for early developers  is to just set it on the form control. But setting the allow edit “false” at the control level can have serious consequences. Watch the below video that shows you how easy it is to override this setting.

The ideal approach is to find the deeper level either in the form datasource or do it at the table level. This best practice would help retain the integrity of the application.

[tweetmeme source=”casperkamal” only_single=false]

Renaming a Primary key like ItemId in Dynamics Ax

June 15, 2010 1 comment

Whenever I go for a customer demo i try to align my data with their portfolio. It can be tedious if we try to create the entire data again. What i do is I smartly rename all the existing items instead of recreating the data. Ax has a handy option that lets you do this easily. Through this option you can even rename primary key’s not just item Id. Watch the video below to understand more.

Guess you will find it useful tooooo…..:)

Access the query of a formDatasource in Dynamics Ax

June 4, 2010 4 comments

We all know well that to access the datasource in a form we use table name suffixed by DS. But there is one another similar suffix that can help us access the datasource query. See example below to understand.


//note the suffix "_q"used to access the query.

This is not widely used but can be of help at times.

Opening Forms with Pre-applied filter using menuitem in Dynamics Ax

June 1, 2010 Leave a comment

We always use a selective set of data in testing features. Take an example of  InventTable and say you are testing import of items using AIF. In this case every time you import you will be trying to open and search with a specific search string like an item name  “AB*”

How nice it would be if you can open the form with the filter applied by default and that too from the menu item…go on to see the video to find how  you can do that in Dynamics Ax.

Adding “Go to main table” for a display field in Dynamics Ax

April 21, 2010 2 comments

Refer to the article below  for a good article that displays how you can add the go to main table option for unbounded fields in Ax

Article about refreshing data in form.

April 9, 2010 Leave a comment

I have always seen people having  confusion when it comes refreshing the data in a form. Here is a nice article from Kashperuk that can help you get clarity in this ….

Setting up Form size during runtime in Dynamics Ax

April 7, 2010 3 comments

Sometime we change  or construct a form at  runtime. In those situation we end up modifying/setting the width and height at run time itself.

there is one thing you need to keep in mind if you are doing that.

Don’t use the following way to set the size of the controls in forms


then nothing happens for the Form. The form size is actually set to zero.

Instead you must do it the following way….

For Auto/ColumnWidth, height properties, set it like this


For setting manual values set it like this


I’m not sure for what reason it is done like this 😦