Bug AX 2012 R2 with Client performance options

Question Status

Suggested Answer
Brandon Wiese asked a question on 13 Aug 2013 11:49 AM

There appears to be a race condition when opening some forms in AX 2012 R2 when the Client performance option of "Form pre-loading enabled" is checked.

The problem seems to most readily manifest on complex forms with lots of controls that are personalized by users.  In our case we discovered it with users opening LedgerJournalTransVendInvoice and LedgerJournalTransVendPaym (which incidentally we had not modified from the SYS layer at all).  There were other issues with SalesTable as well.

While opening journal lines, we experienced the following error message.

DimensionDynamicAccountController object not initialized.  Stack track.. \loadSegments().

This event occurs once for everyone Account number control (including Offset account number) on the form, so it is possible to see anywhere from 2 to 6 errors in the stack trace merely by opening the form.  

Debugging with breakpoints shows that the loadSegments() event for each of these controls fires during the Form's init() method, and before the necessary DimensionDynamicAccountController objects have been constructed.  Normally the loadSegments() method of the account number controls should not fire until the control is activated for edit.  This problem even occurs when opening journal lines for posted journals, where the data source itself is not allowed for edit, and before the user has any ability to focus on a control at all.

This appears to be a race condition, since it can in some cases be highly reproducible and in others can be difficult to reproduce, even while simply opening and closing the journal lines form in quick repetition and doing nothing else.  Clearing the AUC and SysLastValue for the user can bring temporary relief.  

The problem appears to either require or be highly correlated to user modifications to the form, even as simple as moving a single column within the primary grid.

The problem also appears to depend upon the Form pre-loading enabled option under Client performance options being checked.  Note that this option can become checked WITHOUT YOUR CONSENT, and here is how.

After upgrading to AX 2012 R2, the first time you open the SysClientPerf form the following code will run (see below).  This code notices that the record is from an older configuration and AUTOMATICALLY sets the IsFormPreloadingEnabled to True as a default value.  In our case, we upgraded to R2 in early March and never opened the SysClientPerf form for nearly 6 months, but immediately upon merely opening and closing the form in our production environment began to experience these issues across many users.

Hope this helps someone else.

public void EnsureSingleRecordExists()

{

   /// <foundation>

   #define.CurrentVersion(1)

   select firstonly RecId, CurrentVersion from this;

   /// </foundation>

   if(!this.RecId)

   {

       //Default these two enum values to Yes.

       this.FactBoxesEnabled = NoYes::Yes;

       this.PreviewPanesEnabled = NoYes::Yes;

       this.AutomaticEnhancedPreviewsEnabled = NoYes::Yes;

       /// <foundation>

       this.IsFormPreloadingEnabled = NoYes::Yes;

       /// </foundation>

       this.insert();

   }

   /// <foundation>

   else

   {

       // Make sure the version number is current and perform any necessary

       // upgrade steps.

       if (this.CurrentVersion != #CurrentVersion)

       {

           ttsBegin;

           select forUpdate this where this.RecId == this.RecId;

           switch (this.CurrentVersion)

           {

               case 0:

               // Enable form pre-loading by default.

               this.IsFormPreloadingEnabled = NoYes::Yes;

           }

           this.CurrentVersion = #CurrentVersion;

           this.update();

           ttsCommit;

       }

   }

   /// </foundation>

}

Reply
Thomas Meersschaert responded on 6 Jan 2014 5:17 AM

Thank you for the information. This helped!

Reply
Emad Hamdi responded on 26 Feb 2014 1:31 AM

Dears kindly ,

do you mean i have to change the value to be no in the table browser of SYSCLIENTPERF ?

Reply
karthik ravi responded on 5 Jun 2014 5:39 AM

Hi All

How to resolve that issue ?

if i set IsFormPreloadingEnabled option as true getting above error.

if i disable it the error was removed but facing some other performance issues when running reports .

please help me

Reply
Thomas Meersschaert responded on 5 Jun 2014 5:51 AM

Hello,

We've ended up contacting Microsoft as the error occured on multiple forms. MS provided us hotfix 2816385 which solved the error.

Be sure to delete the .auc files when compiling after installing the hotfix as not doing this has caused a table to become a view on our environment.

Reply
Jayapriya responded on 6 Jun 2014 2:33 AM

What is the use of FormPreLoad? is it mandatory to set as YES in AX 2012 r2?

this.IsFormPreloadingEnabled = NoYes::Yes; ?

Reply
Mehrnoosh Baratpour responded on 20 Jul 2014 4:07 AM

Hi,

I'm having the same problem.

After downloading KB 2816385, I found out that there are 17 .msp files in there. (clientoba32/64 , components32/64 , objectserver32/64 , etc.)

Is there any instruction for installing it, or could you please help me to install the hotfix?

Reply
Suggested Answer
Kevin Kidder responded on 22 Jul 2014 12:27 PM

Installing any hotfix should be done by running the AXUpdate.EXE file. More information about how to install Dynamics AX 2012 hotfixes can be found in TechNet under the following location: technet.microsoft.com/.../hh335183.aspx

Reply
Suggested Answer
Alex Voytsekhovskiy responded on 11 Jan 2017 2:31 PM

Very useful!

Reply
Suggested Answer
Kevin Kidder responded on 22 Jul 2014 12:27 PM

Installing any hotfix should be done by running the AXUpdate.EXE file. More information about how to install Dynamics AX 2012 hotfixes can be found in TechNet under the following location: technet.microsoft.com/.../hh335183.aspx

Reply
Suggested Answer
Alex Voytsekhovskiy responded on 11 Jan 2017 2:31 PM

Very useful!

Reply