Ax2009 Event Processing Error

February 22, 2012 2 comments

I have a customer that gets a error every time the EventJobCUD-batch (Change Based Events) runs. They got the following error:

After some reseach I found out that when 2 fields are changed at the same time, you go several times through the listChangedFieldsEnumerator (location ClassesEventProcessorCUDprocessUpdate)

1
2
3
4
5
6
7
8
9
while (listChangedFieldsEnumerator.moveNext())
{
    // In this simple case we use the new and the original changed field value as
    // recorded at event detection time:
    [thisFieldId, changedFieldValue, origChangedFieldValue] = listChangedFieldsEnumerator.current();
 
    if (rule.AlertFieldId == thisFieldId)
        break;
}

The code underneed simulates the same situation in a small job:

1
2
3
4
5
6
7
8
9
static void Job5(Args _args)
{
    anytype any;
    ;
    any = ABC::A;
 
    // next line will throw a error
    any = BatchStatus::Canceled;
}

And here we get the basic same error “Error executing code: Wrong argument types in variable assignment.”

I modified the code so the anytype is assigned only when the field is correct:

1
2
3
4
5
6
7
8
9
10
11
12
while (listChangedFieldsEnumerator.moveNext())
{
    // In this simple case we use the new and the original changed field value as
    // recorded at event detection time:
    thisFieldId = conpeek(listChangedFieldsEnumerator.current(), 1);
 
    if (rule.AlertFieldId == thisFieldId)
    {
        [thisFieldId, changedFieldValue, origChangedFieldValue] = listChangedFieldsEnumerator.current();
        break;
    }
}

Install Ax2012 on SQL Server 2012 RC0

February 13, 2012 2 comments

During the preparations for Microsoft TechDays 2012 my colleague and I installed a fresh Windows Server 2008 R2 with SQL Server 2012 and Ax 2012. At first all seems to work (the AOS started and we could login with the client), but when we started to prepare and opened the ‘Datasource Name’ lookup on the ‘Document Datasources’ we got an error. After some research my colleague Kenny found that the SQL UtilElements-view used a deprecated keyword called FASTFIRSTROW. After updating the view this functionality seems to work fine. (more…)

TechDays 2012 – Extending the reach of your Microsoft Dynamics AX Application with the next-gen tools

January 7, 2012 No comment

On February th 14th this year I am giving my first presentation on TechDays 🙂 You can view some details about my presentation on
http://www.microsoft.com/belux/techdays/2012/SessionDetail.aspx?sessionId=275

Social Media for Microsoft Dynamics Partners

December 15, 2011 No comment

I was looking for some new Ax books and came accross a book titled ‘Social Media for Microsoft Dynamics Partners’  on Amazon.com

Authors: Jon Rivers, Mark Polino
Description: Social Media for Microsoft Dynamics Partners is a short, introductory book geared toward the specific business needs of Dynamics VAR’s and ISV’s. There are plenty of generic social media guides available, and Microsoft provides some guidance to partners, but we felt that Dynamics partners were missing an independent source of social media help designed for their business. So we wrote one.

I’m not sure if I’ll buy a copy, but maybe I’ll ask a copy for christmas 🙂

Ax 2012 Editor improvements

December 2, 2011 No comment

In Microsoft Dynamics AX 2012, a new X++ Editor is introduced which replaces the current legacy editor. The new X++ Editor is based on hosting a Visual Studio 2010 Editor Framework control.

Here are a few Tips & Tricks:

You can find more on chanel 9

Change the language at runtime

November 30, 2011 No comment

Normally when you change your language you go to your user options, change your current language and the restart the client. This week I got the question if it was possible to do so in runtime. You can do so by just calling the infolog.language(str 7 _languageCode). All labels that you load after calling this method will be translated to the new language. (more…)

Amount in words

November 28, 2011 No comment

This week one of my customers asked me to place the amount in words on a invoice. I couldn’t believe that sush function wasn’t availible in standard Ax. After some research I found that the Global-class contains the following methods:

(more…)

How to run a Microsoft Ax 2012 Hyper-V on VirtualBox (Enterpris Portal Problem)

November 26, 2011 1 comment

In my previous post I described how to run the standard Microsoft Ax 2012 Hyper-V VPC on your regular Windows Client with VirtualBox. There was one thing I forgot to mention, when you want to use the Enterprise Portal (and you probably will) you need to adjust the windows hosts-file on the VPC.

How:

Now the file should look like this:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a ‘#’ symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#    127.0.0.1       localhost
#    ::1             localhost
127.0.0.1       dynamicsax.contoso.com

How to run a Microsoft Ax 2012 Hyper-V on VirtualBox

November 25, 2011 2 comments

For the moment Microsoft provides us with with demo-VPC’s for Windows Server Hyper-V. In this post I will describe step-by-step how you can run the same vhd with VirtualBox on your Windows Client. (more…)

Convergence 2012 – Houston

November 18, 2011 No comment

I know I just got back from the technical conference bu I came through the announcement for the Convergence 2012 “A World Of Opportunity” in Houston (Texas) The conference will start on the 18th of march and will end on the 21nd. So try to clear your note between these dates.

« Previous PageNext Page »