Browsing all articles tagged with Dynamics AX 2009 Archives - Amer Atiyah, Microsoft Dynamics 365 Blog
5

If you have ever came across a case where you found Dynamics AX girds showing only the first line of data… don’t get afraid, you still have all the data.

Basically to solve the issue, insure that the client you’re using has the very same version of your Dynamics AX AOS. You could do that by installing the right Microsoft Dynamics AX SP and Rollup version. :)

2

If you have ever used the General Ledger AIF service of the Microsoft Dynamics AX 2009, you might have noticed the limitation of not integrating other than Ledger transactions. For example, you cannot send Customer and Vendor transactions through that AIF Service.

I came across a requirement where I needed to integrate external Vendor and Bank transactions through AIF. After spending sometime on testing as well as on X++ code tracing… I came to know that Microsoft is putting some restrictions on the code to not to accept the Ledger Journal transactions of types other than Ledger.

The following code is a standard X++ code that was written to prevent such integration.

37
38
39
40
41
42
43
44
45
46
47
48
49
//LedgerJournalTableType (class) -- initializeLedgerJournalName (method) -- Line number 37
/*Commented to disable the Non-Ledger type restriction*/
    if (!true /*this.isJournalNameValidJournalType()*/)
/*Commented to disable the Non-Ledger type restriction*/
    {
        AifFaultContext::setGlobalContextField(tableId, fieldId);
        AifFault::checkFailedLogFault(strfmt("@SYS114718", axLedgerJournalTable.parmJournalName(), axLedgerJournalTable.parmJournalType()), #InvalidJournalNameJournalTypeCombination);
        throw AifFault::faultList("@SYS98197", #ValidationFailed);
    }
/*Initilizing the journal type from the journal name*/
    ledgerJournalTable.JournalType = ledgerJournalName.JournalType;
/**/
}

Also I have changed:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//Amer Atiyah, http://www.amerax.net/
//LedgerJournalTransType (class) -- validateAccountType (method) -- Line Number 1
protected boolean validateAccountType()
{
    boolean         isValid = true;
    ;
 
    switch (ledgerJournalTable.JournalType)
    {
        case LedgerJournalType::Daily :
                /* I had to comment this code to prevent the validation
                if (ledgerJournalTrans.AccountType != LedgerJournalACType::Ledger)
                {
                    if (this.isConsumerStateTracked())
                    {
                        // AX5 service limitation
                        isValid = AifFault::checkFailedLogFault("@SYS117885", #AccountTypeMustBeLedger);
                    }
                }*/
            break;
 
        default :
            break;
    }
 
    return isValid;
}

What I like to mention in here is that Microsoft Dynamics AX 2012 now supports integrating Vendor, Customer, and Bank transactions out-of-the-box. I copied the following code from the LedgerJournalTransType class in Dynamics AX 2012 without doing any changes to it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
protected boolean validateAccountType()
{
	boolean isValid = true;
 
	this.initializeLedgerJournalTable();
 
	switch (ledgerJournalTable.JournalType)
	{
		case LedgerJournalType::Daily :
			if(LedgerJournalTrans.AccountType != LedgerJournalACType::Ledger &&
			   LedgerJournalTrans.AccountType != LedgerJournalACType::Bank &&
			   LedgerJournalTrans.AccountType != LedgerJournalACType::Vend &&
			   LedgerJournalTrans.AccountType != LedgerJournalACType::Cust)
			{
				if(this.isConsumerStateTracked())
				{
					isValid = AifFault::checkFailedLogFault("@SYS117885", #AccountTypeIsNoSupported);
				}
			}
			break;
		default;
			break;
 
	}
 
	return isValid;
}
4

Happy new year :)

I got a SQL error today when I tried to open the “BI project generation options” form in Dynamics AX. The error was like the following:

When walked through the code, I discovered that it tries to delete some entries from a table called: “UDM Roles (BIUdmRoles) throw a SQL statement but unfortunately that SQL statement is mistyped!

To correct the issue, go to AOT –> Classes –> SRSStatement –> deleteInvalidBIUdmRoles method and write the code between my comments as below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//Amer Atiyah, http://blog.amerax.net/
public static void deleteInvalidBIUdmRoles()
{
    BIUdmRoles udmRoles;
    UserGroupInfo userGroupInfo;
    str list = #emptyString;
 
    Connection connection;
    Statement statement;
    SqlStatementExecutePermission permission;
 
    str sqlStatement = @"DELETE FROM %1BIUDMROLES WHERE USERGROUPID IN (%2)";
    ;
 
    while select udmRoles
    {
        select userGroupInfo where userGroupInfo.Id == udmRoles.UserGroupId;
        if (!userGroupInfo)
        {
            if (strlen(list) > 0)
            {
                list += #comma;
            }
            /*Comments Begin*/
            //list += udmRoles.UserGroupId;
            list += "'" + udmRoles.UserGroupId + "'";
            /*Comments End*/
        }
    }
0

Tracing Role Center KPIs

If you wanted to know where the KPIs in Dynamics AX 2009 are getting its values from, then you might need to have a look at this document:

This documents describes in detailes how to trace those values in Visual Studio.

Have fun!

4

I had an issue where I needed to install a new Enterprise Portal on a server that has two AOS’s: TEST and DEVELOPMENT.
The TEST AOS has already an Enterprise Portal installed and configured. The requirement was to install an Enterprise Portal also for the DEVELOPMENT AOS.
When I successfully completed the installation, I figured out that the Websites form (in Administration –> Setup –> Internet –> Enterprise Portal) in TEST contains two websites! The old and the new one. I tried to delete the new website from this form and I also added an entry in the same form on the DEVELOPMENT environment. But, for some reason the EP was showing incorrect results like this:

Enterprise Portal

I solved the issue by letting the .NET Business Connector Configuration points to the DEVELOPMENT environment! Before that, I have un-installed that new EP.

Then I was able to deploy the EP on the DEVELOPMENT environment :).

4

I had an issue where I needed to install a new Enterprise Portal on a server that has two AOS’s: TEST and DEVELOPMENT.
The TEST AOS has already an Enterprise Portal installed and configured. The requirement was to install an Enterprise Portal also for the DEVELOPMENT AOS.
When I successfully completed the installation, I figured out that the Websites form (in Administration –> Setup –> Internet –> Enterprise Portal) in TEST contains two websites! The old and the new one. I tried to delete the new website from this form and I also added an entry in the same form on the DEVELOPMENT environment. But, for some reason the EP was showing incorrect results like this:

Enterprise Portal

I solved the issue by letting the .NET Business Connector Configuration points to the DEVELOPMENT environment! Before that, I have un-installed that new EP.

Then I was able to deploy the EP on the DEVELOPMENT environment :).

3

Convert All Hirji Formats into Gregorian

I came across a requirement where I needed to convert users entry from Hirjri Calendar date (the Islamic Calendar) into the Gregorian Calendar. In previous posts, I have shown how to convert Gregorian Date (date data type in Dynamics AX) into Hirjri… if you are interested in those check them out here:

In order to convert a Hirji date into Gregorian, I used the .NET classes referenced in the any Dynamics AX standard version.

Enjoy!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//Amer Atiyah, http://blog.amerax.net
static date hijri2GrDate(DAPHijridateStr   hijriDateStr)
{
    System.Globalization.CultureInfo arCul = new System.Globalization.CultureInfo("ar-SA");
    System.Globalization.CultureInfo enCul = new System.Globalization.CultureInfo("en-US");
    System.DateTime                  tempDateTime;
    str                              strTemp;
    System.String[]                  arr;
    date                             grDate;
;
 
    //all expected dates formats
    arr = new System.String[18]();
    arr.SetValue("dd M yyyy",  0);
    arr.SetValue("yyyy/MM/dd",  1);
    arr.SetValue("yyyy/M/d",    2);
    arr.SetValue("d/M/yyyy",    3);
    arr.SetValue("dd/MM/yyyy",  4);
    arr.SetValue("yyyy-MM-dd",  5);
    arr.SetValue("d/MM/yyyy",   6);
    arr.SetValue("dd/M/yyyy",   7);
    arr.SetValue("yyyy-M-d",    8);
    arr.SetValue("dd-MM-yyyy",  9);
    arr.SetValue("yyyy MM dd",  10);
    arr.SetValue("d-M-yyyy",    11);
    arr.SetValue("d-MM-yyyy",   12);
    arr.SetValue("dd-M-yyyy",   13);
    arr.SetValue("d M yyyy",    14);
    arr.SetValue("dd MM yyyy",  15);
    arr.SetValue("yyyy M d",    16);
    arr.SetValue("d MM yyyy",   17);
 
    try
    {
        tempDateTime = System.DateTime::ParseExact(hijriDateStr, arr, arCul, System.Globalization.DateTimeStyles::AllowWhiteSpaces);
    }
    catch
    {
        error("Unexpected Hirji date format.");
        return datenull();
    }
    strTemp = tempDateTime.ToString("dd/MM/yyyy");
    grDate = str2date(strTemp, 123);
 
    return grDate;
}

It might a great idea if you added this method to the “Global” class, like what I did :).

Hirji into Gregorian

22

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 FilesMicrosoft Dynamics AX50Workflow“). 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 clicking (selecting) the “Applicaiton” you have just converted and double clicking “Authentication” and I insured 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. You cannot do that if if you have a kerberos authentication configured in your environment, if not.. then you better disable it to improve your environment performance.
  • I then went to the “Handler Mapping” of the Workflow Application. I selected “WebServiceHandlerFactory-ISAPI-2.0” and then clicked “Edit”. I insured that the “Executable” path is pointing to the .NET framework version 2.0 32-bit. (Note that this Windows contains on two versions of framework handlers and in two different folders inside the “C:WindowsMicrosoft.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. :)

0

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 ClassesSysEPDeploymentcreateDevWebsiteProxyDir.

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 :).

362

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@amerax.net and I will be more than happy to send the project to you.

I also would welcome any feedbacks on this. :)

0

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 AX50ClientBinHelp

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)

5

One of the few issues in Microsoft Dynamics AX 2009 that I always blaming Microsoft for not giving it in a proper way is: installing, configuring and administrating the EP (with all its related components line the SSRS, SSAS, IIS and WSS/MOSS). A great feature like this shouldn’t be left away like this Steve :)… we are dying, customers are blaiming, and partners are loosing money!

I had one issue in the last few days when I “re-installed” the EP, SSRS and SSAS then my client played with the environment and destroyed the installation. The environment was like the following:

  • SQL Server Reporting Services database is installed on another machine (Database server) than the windows service of SSRS (web server).
  • I had to use the Kerberos authentication to manage this distributed scenario

After completing the installtion of EP, SSRS and SSAS, configuring them and processing the cubes I had this error: “An error has occurred while establishing a connection to the analysis server.

Dynamics AX EP with Analaysis Services Connectivity Error

After invistigations, I discovered that the ODC file is not deployed to the EP. (ODC file is a file used to set the connnection string between the EP WSS and the Analysis Services.) You could check the ODC files by going to: Dynamics AX Enterprise Portal –> Site settings –> Site Administration –> Site Libraries and Lists –> Customize “Data connections” and then in the header area click Data Connections in the path: EP Site –> Data Connections –> Settings.

You could deploy the ODC file from within Microsoft Dynamics AX 2009 desktop client by clicking the Delpoye ODC Files button in the OLAP Administration form (Administration –> Setup –> Business analysis –> OLAP –> OLAP Administration).

OLAP Administration

But sometimes you will not be able to upload this file, and you will get an error when trying to connect to SQL and you have to check the Windows Event Log to follow that error up.

If so, then you have to maually create/upload the ODC file(s). A great post was written regarding the same issue on how you upload those ODC files specifically for Dynamics AX 2009 cubes. How to manually deploy ODC Files to Microsoft Dynamics AX 2009 Enterprise Portal.

In this post shortly the writer gives those ODC files so you could:

  1. download them,
  2. change the connection string to match yours and then
  3. deploy them to your environment

Have fun :).

Dynamics AX 2012 Event

Recent Posts

Tags

Archives

Random Testimonial

  • ~ Muzammil Ahmad, ERP Manager at Abdul Aziz Alsorayai Investment Group

    33a1e92"Thing that I have seen in Amer in a broader view, that, he is a type of guy who takes the tasks in a professional way,concentrate on tasks, work on them with a cool & calm mind but fullfil the tasks in time. Having a humble nature, its normally a pleasure for everyone to work with Amer"

  • Read more testimonials »