Microsoft Dynamics AX Technical Conference 2011

Install Silverlight

Workflow validation error: The request failed with HTTP stauts 405: Method Not Allowed.

I have faced this error twice, I sloved it the first time by “Enabling the 32-bit Applications” on the application pool level of the workflow.

But in another time the installation was on Windows 2008 R2, and this made things harder. Enabling the 32-bit Application did not solve the issue. This actually happened because of the conflict in this Windows between the .NET framework 2.0 and .NET framework 4.0. It also might be caused of an authentication issue, so you better check that all one by one to get this validation problem resolved.

To solve the issue, I basically have gone through these steps: (of course I followed those steps after installing the workflow and I did not uninstall it)

  • Deleted the application from the IIS (the selected node in the picture below).

  • Added a “Virtual Directory” to the same site and named the new virtual directory with the same name of the deleted application.
  • In the physical path of the virtual directory, I pointed to the installed worklfow folder (most probably will be in “C:\Program Files\Microsoft Dynamics AX\50\Workflow“). This folder contains the web services of AX workflow.

  •  Then, I converted the new “Virtual Directory” to “Application” by right-clicking that directory and clicking “Convert to Application”.
  • I went to permissions of that application, by right clicking the “Applicaiton” and selecting “Edit Permission” and I insued that “ASP.NET Imporsenation” and “Windows Authentication” are enabled and any other things are disabled.
  • (Optional) You might disable the Kernel-mode authentication for the Windows Authentication by clicking the “Advanced settings” for the Windows Authenticaion.
  • I then went to the “Handler Mapping” of the Workflow Application. I selected “WebServiceHandlerFactory-ISAPI-2.0″ and then clicked “Edit”. I insued that the “Executable” path is pointing to the .NET frameword version 2.0 32-bit. (Note that this Windows contains on two versions of framework handlers and in two different folders inside the “C:\Windows\Microsoft.NET” folder.) In our case, you always have to point to the “aspnet_isapi.dll” file in the “Framework” folder not “Framework64″.

By this, you will be able to browse anyone of the *.asmx files in the Workflow Application. Also you might validate your workflow configuration.

Hopefully it has been resolved to you as well. :)

Enterprise Portal “Generate Proxies” Form: ClrObject static method invocation error.

I have examined an error while trying to re-generate the proxies classes that are used in the Enterprise Portal.

When I traced the code, I discovered that this tool is actually updating .NET proxies classes based on the EP installation physical path. For some reason, this tool was not able to get that path.. the generated path was: “” (empty string).

What I did is that I got the physical path of the proxy classes, and changed the code where it tries to get that path and fixed it. This is done in Classes\SysEPDeployment\createDevWebsiteProxyDir.

This code shows what I did:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
public static client str createDevWebsiteProxyDir()
{
    #AOT
 
    Microsoft.Dynamics.Framework.Deployment.Portal.EPSharepointAdmin epSharepointAdmin;
    EPGlobalParameters epGlobalParam;
    str dir;
 
    select firstonly epGlobalParam;
 
    if(!epGlobalParam.DevelopmentSiteId)
        // UA!No development web site.
        throw error('@SYS108771');
 
    epSharepointAdmin = new Microsoft.Dynamics.Framework.Deployment.Portal.EPSharepointAdmin();
 
    /*comment from here
    dir = epSharepointAdmin.GetAppCodeDirectoryFromSiteId(guid2str(epGlobalParam.DevelopmentSiteId));
    comment to here*/
 
    //add this line of code (My installation was on this path)
    dir = "C:\\inetpub\\wwwroot\\app_code";
    //In Dynamics AX VPC1, the installation is on this path <>
    dir = "C:\\Inetpub\\wwwroot\\wss\\VirtualDirectories\\sharepoint80\\App_Code";

Here is where the EP proxies classes to be generated and hence used by the Dynamics AX EP.

By this, the tool just worked fine :) .

Create Dynamics AX Workflows in Three Easy Steps by Workflow for Dummies Wizard

As I have mentioned in an earlier post, to get my life easier with developing new Dynamics AX Workflows I have created an easy to use wizard that generates AOT objects for one Approval workflow in Dynamics AX 2009, without writing a single line of code. I have used this wizard since more than a year to develop all the workflows that I had to develop.

I have been asked many times by Dynamics AX technical and functional consultants to share that with them. And here I am sharing it with the Dynamics AX community.

By following three steps, Dynamics AX Workflow for Dummies simply:

  1. Adds a Workflow Template
  2. Adds a Workflow Category
  3. Adds a Workflow Approval
  4. Adds a workflow state field to the selected table
  5. Enables the workflow for the selected form
  6. Creates needed classes like the document class for the workflow document
  7. Creates a query (Workflow Document)

Here are the steps that you have to follow: (pictures speak quietly)

Wizard menu

Welcoming message

General information

Generated AOT Objects Parameters

Generated AOT Objects Parameters

Generated AOT Objects Information

After clicking Finish, you would get a Dynamics AX Project:

Workflow Project

Generated AOT Project

In order to configure the generated Workflow template, go to the module that you have selected in the wizard, and open the Workflow Configuration under the Setup menu of that module. This is what you will have:

Workflow Configuration

If you are interested to have it, just comment on this post and write me your email or send me an email to amer@amer-ax.com and I will be more than happy to send the project to you.

I also would welcome any feedbacks on this. :)

Some Cool Statistics about Microsoft Dynamics AX

A study was done by Job Graphs (http://www.jobgraphs.com/) for Microsoft Dynamics AX as a global software product. I leave you with the graphs.

Dynamics AX – Modules demand trend

Modules demand trend

Salary Comparison

Salary Comparison

Dynamics AX – Role Wise Comparison

Role Wise Comparison

Dynamics AX – Experience based demand trend

Experience based demand trend

Dynamics AX World Wide Demand

Dynamics AX World Wide Demand

Source: http://jobgraphs.com/dynamics-ax/

Build Arabic Templates for Office 2010, Receive Microsoft Hardware!

Build Arabic Templates for Office 2010, Receive Microsoft Hardware!

Arabic Help Files for Dynamics AX 2009

Arabic Help Files

Download

If you don’t have the Arabic help files of Dynamics AX you could download them from here:

To install the downloaded file to your environment, you have to get it copied to all the clients that needs to access the help files in an Arabic version. To get that, do the following:

  1. Download the files
  2. Unzip the folder in order to to get the “AR” folder
  3. Copy the unzipped folder in each client into: <<Installation folder>>\Microsoft Dynamics AX\50\Client\Bin\Help

By this you will be able to read the help files in the Arabic version.

And of course, do not forget to turn the Help language in the User Options form into AR!

User options form (Click to enlarge)

Here we are :)

Help in Arabic (Click to enlarge)

How to Use Number Sequence Engine Efficiently with Dynamics AX Forms

If you wanted to write a an X++ code to generate a number sequence and assign it to a field, you might use the following X ++ statement.

1
yourTableBuffer.Field = NumberSeq::newGetNum(NumberSequenceReference::find(TypeID2ExtendedTypeId(TypeId(YourExtendedDataType)))).num();

But, what you could do if you have that field in form and you want to generate a number sequence while the user creates a new record is the class NumberSeqFormHandler.

NumberSeqFormHandler is a great class that doesn’t only take care of generating a new number sequence for your field… but also it takes care of removing or inserting that number in the Number Sequence List table when the number is not used (in case that the record hasn’t been inserted although the number has been already generated).

To use the NumberSeqFormHandler class, you have to declare a NumberSeqFormHandler object in the class declaration. Also you have to create a method at the Form level like the following:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
//Form level method
NumberSeqFormHandler numberSeqFormHandler()
{;
    //you should have been declared numberSeqFormHandler variable in the ClassDeclaration of your form
    if (!numberSeqFormHandler)
    {
        numberSeqFormHandler = NumberSeqFormHandler::newForm(NumberSequenceReference::find(TypeID2ExtendedTypeId(TypeId(YourExtendedDataType))).NumberSequence,
                                                             element,
                                                             YourDataSourceName,
                                                             fieldnum(YourTableName, Field));
    }
 
    return numberSeqFormHandler;
}

Then you need to actually call the NumberSeqFormHandler class methods like:

1
2
3
4
5
6
7
8
9
//Form methods
public void close()
{
    if (numberSeqFormHandler)
    {
        numberSeqFormHandler.formMethodClose();
    }
    super();
}
1
2
3
4
5
6
//DataSource method
public void write()
{
    element.numberSeqFormHandler().formMethodDataSourceWrite();
    super();
}
1
2
3
4
5
6
7
8
9
10
//DataSource method
public boolean validateWrite()
{
    boolean ret;
 
    ret = super();
    ret = element.numberSeqFormHandler().formMethodDataSourceValidateWrite(ret) &amp;&amp; ret;
 
    return ret;
}
1
2
3
4
5
6
//DataSource method
public void linkActive()
{
    element.numberSeqFormHandler().formMethodDataSourceLinkActive();
    super();
}
1
2
3
4
5
6
//DataSource method
public void delete()
{
    element.numberSeqFormHandler().formMethodDataSourceDelete();
    super();
}
1
2
3
4
5
6
7
8
9
//DataSource method
public void create(boolean _append = false)
{
    element.numberSeqFormHandler().formMethodDataSourceCreatePre();
 
    super(_append);
 
    element.numberSeqFormHandler().formMethodDataSourceCreate();
}

By this you will have your form works efficiently with the Number Sequence engine of Dynamics AX  and you don’t have to write any code at the table level… so remove all that code that you might have written at the initValue method of your table.

One last important thing, NumberSeqFormHandler works with Continuous and non-Continuous number sequences. But if you want to “regenerate” the unused numbers that have been previously generated, you have to set your number sequence as Continuous of course.

How to Create a Primary Key for a Dynamics AX Table

This topic might not be new to most of you guys, but I always wondered how can I create a primary key to a Dynamics AX table?

You could easily create index in any table in Dynamics AX and you could specify that this index is “not duplicated”, which means that values of the field(s) should be unique among the table values. But this does not mean that you this index is a Primary Key index!

To create a Primary key you have to set the PrimaryIndex property in the list of that table properties.

PrimaryIndex Property

When you choose the PrimaryIndex property you have to set that index as “not duplicated”. Once you do that, you will have the icon of that index changed to be like this:

Primary Key Index Icon

The New Dynamics AX 2011 X++ Editor

New features have already been added to the next version of Dynamics AX, Microsoft Dynamics AX 2011.

One of the very great features is the X++ Editor. I used to write X++ since Microsoft Axapta 3.0, there has been some slight changes between Axapta 3.0 to Dynamics AX 2009. But it looks that Microsoft is really doing the X++ editor looks somehow closely to the great editor of Microsoft Visual Studio .NET.

Some of the new features include:

  1.  Ability to see lines in code
  2. Improved IntelliSense features (all possibilities will appear once you type)
  3. Great ability to select words in editor without selecting the line from the beginning
  4. More colors
  5. Ability to check Labels value without going to the Label Editor
  6. .. and many more.

Check out this video :) You will enjoy it.

 

Amer Adnan Atiyah