Wednesday, 7 December 2016

Linking users to Financial Dimensions

Hi All,

At first I thought this as a weird requirement, but later I felt like everything can be possible in AX with configuration or customization.

One of my clients requirement is "When a user logs in to AX and creates a journal(in AR/AP/GL), by default all the financial dimensions have to be auto populated. Where ever module the user is working and has financial dimensions need to be set, all those need to be auto populated by default."

From technical perspective, i thought of having a new form that maps user names with the financial dimensions and then applying record level security where ever it is required.

But all these extra customisations are not needed at all. This can be done with simple configuration by following the below steps.

1. Go to Human Resources - Common - Workers.

2. Select the required worker.

3. Click 'Edit' in the menu bar.

4. In the new form opened, click on 'Employment history' in the Action pane.

5. In the Employment history form, select the company for which you want to set default financial dimensions.

6. Expand the Financial dimensions fast tab.

7. Here you can give the default financial dimension values and close the form.

8. Restart AX and Login with the user.

Now you will be able to see financial dimensions getting auto populated.

Please let me know If you have any queries.

Wednesday, 4 February 2015

Passing Enum value between forms in ax 2012

Hi Daxers,

When working on forms you may need to pass an enum value between the forms.
We can pass the enum value to a child form by setting the enum type and enum value for the args of parent form and pass that args to the child form.

Syntax:
args.parmEnumType(enumNum(<enumName>));
args.parmEnum(<enumValue>);

For example,

Parent Form:
args.parmEnumType(enumNum(PrintCopyOriginal)); //Setting the enum Type.
args.parmEnum(PrintCopyOriginal::OriginalPrint); //Setting the enum value for specified enum type.

//pass this 'args' to the child form

Child Form:
args.parmEnum(); // Returns the enum value that was set.


Enjoy Daxing!

Monday, 22 September 2014

To make a button or field visible/invisible in list pages

We can have interaction classes for all the list pages. Taking examples for list page such as SalesTableListPage, the interaction class is SalesTableListPageInteraction.

This interaction class is extending the SysListPageInteractionBase that have the following methods

setButtonVisibility()     - To set the buttons visible/invisible
setGridFieldVisbility() -  To set the grid fields visible/invisible

These methods are protected, so override them.

To make a button Invisible,

this.listPage().actionPaneControlVisible(formControlStr(SalesTableListPage, NewGroup), false);

To make a field Visible,

this.listPage().listPageFieldVisible(formControlStr(SalesTableListPage, SalesTable_createdDateTime), true);

Thursday, 7 August 2014