Monday, June 30, 2014

Validate fields to accept Numeric values only. AX 2012 / Ax 2009 . textChange()

  Validate Field with Numeric values only.
There are often times, when we need to validate fields to accept values which are numeric only. For example telephone numbers.
The below code can help us achieve this.

public void textChange()
{
    super();
    this.text(strkeep(this.text(), "0123456789"));


Thanks, 

Thursday, April 24, 2014

AX 2009 Financial Dimensions Vs AX 2012 Financial Dimensions

Hi came across this very useful post which explains the technical differences in the Financial Dimensions Framework in Ax 2012. Technically its different how we use Dimensions in our customized tables in 2009/2012. Hope this helps you guys as well to get an insight of the Dimensional Framework in Ax 2012.


Earlier versions AX 2009, 4.0 :
  • In older version System use to limit the creation of dimensions up to 10. 
  • By default 3 dimensions were available in the system namely Department, CostCenter and Purpose.
    Technically these dimensions were controlled by Enum SysDimension and an array EDT Dimension.
  • So If we have 3 enum elements in SysDimension, then its corresponding array elements are stored in    dimension EDT and can be referred as Dimension[0], Dimension[1].....
  • If you would like to store these dimension values against customized table, then simply we were adding the EDT Dimension to that Table. At Form level simply drag and drop field on Group then system use to  show all the array elements as string control.
New version AX 2012 (6.0) :

  • In AX 60, their is no limit to dimension creations. One can create n number of dimensions as per    organization requirements.
  • Technically their is huge change in framework, the way these dimensions used to be created and stored.
  • Firstly EDT Dimension (array) is deprecated and replaced with DimensionDefault (Int64 RecId).    
  • Financial Dimensions master table Dimension is replaced with DimensionAttribute and DimensionValueDetails.
  • Now if one wish to store these dimension on your customized table then instead of EDT Dimension one should add DimensionDefault EDT.       
  • At Form level make use of DimensionDefaultingController class to show the available dimensions.
How to access Financial Dimensions values in AX 2012:
   
 In earlier version, accessing dimension values was very simple like
                 CustTable.Dimension[0]      ==  Department  value  
                 CustTable.Dimension[1]      ==  CostCenter  value
                 CustTable.Dimension[2]      ==  Purpose       value

 In AX 60, since they have replaced Dimension EDT with RecId DimensionDefault we have to make use of Dimension helper classes to access values.So in CustTable you will find defaultDimension field which stores reference recId for DimensionAttributeSet.    

 I am referring Customer 1101 in CEU Company, Contoso Demo Data for illustration purpose. Note the dimension values for this customer as shown in below snap.


Refer the code to access the values.

static void DEV_Dimension(Args _args)
{
    CustTable                         custTable = CustTable::find("1101");
    DimensionAttributeValueSetStorage dimStorage;
    Counter i;
    
    dimStorage = DimensionAttributeValueSetStorage::find(custTable.DefaultDimension);

    for (i=1 ; i<= dimStorage.elements() ; i++)
    {
        info(strFmt("%1 = %2", DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name,      
                               dimStorage.getDisplayValueByIndex(i)));
    }
}  
 
When you run the job, will see as below

Monday, February 24, 2014

SOLVED : A table, Extended Data Type, Base Enum or class called TableName already exists. Import of Table aborted.

If during import of XPO file, we get the following error.

 A table, Extended Data Type, Base Enum or class called TableName already exists. Import of Table aborted.

This error is basically due to cache and ID mismatch problems for the related ojbects, 

Solution
Cache files - close the client, delete files .AUC files in cache directory:
* C:\Documents and Settings\[USERNAME]\Local Settings\Application Data for Win Xp or Server 2003,
* C:\Users\[USERNAME]\AppData\Local for Vista/Win7.

...and reopen the client, tyr import again.

Hope this helps

Sunday, February 2, 2014

SOLVED : The AOS 'Name@2712' cannot be reached. Setup cannot continue.Verify that you entered the correct server information an that the AOS is running.

While trying to install the reporting services for AX 2012, i can across the following error on the setup.

The AOS 'Name@2712' cannot be reached. Setup cannot continue.Verify that you entered the correct server information an that the AOS is running.


This error is basically because the SetupSupport files pick the wrong/previous/deleted configuration for the Setup. The trick here is that along with the configuration what we fail to update is the Business Connected Proxy Account on the configuration, which normally points to the old server.



Solution :
Navigate to The Client Configuration from Administrative Tools, and change the Client Target to Local Client , and change the configuration to point to the correct AOS.
Navigate to Client Configuration Again, and change the Client Target to Business Connector, and point to the New AOS. :) 
Hope this helps :)
happy Daxing

Thursday, January 30, 2014

SOLVED: SSRS report deployment error in AX 2012


We often encounter the following error while trying to deploy the standard AX 2012 SSRS reports. 

"You do not have privileges to deploy to server: "Server Name". For deployment, you must have administrative rights to the SQL Server Reporting Services (SSRS) server. Contact your administrator to deploy."

This error is basically because of some Admin rights issue. Figuring out a solution for the error can be a task, rather we can follow the following workaround. Though its not a best practice/recommended, but it works.

Solutions:

Try the following command while publishing the default reports

For All Reports : "Publish-AXReport -ReportName * -SkipReportServerAdminCheck"
For Single Report : "Publish-AXReport -ReportName CustTransList -SkipReportServerAdminCheck"

Hope this helps.

Tuesday, January 14, 2014

SOLVED :"Illegal data conversion from original field : unable to convert data types to anything but character field type." Ax 2012 / Synchronization

"Illegal data conversion from original field : unable to convert data types to anything but character field type." 
We often encounter this error while trying to full / partial synchronize database from AX 2012/ Ax 2009 to SQL. I have been trying to figure the exact cause of this error for a long time. But the workaround as suggested by a few in the blogging world which also helped in my case is :

System kernel table : SQLSYNCINFO

This table accumulates the sync issues , and are not reconsidered, which means that old errors which were not solved, or errors of tables dropped still remain in this info table.

truncating this table data from sql and resynchronizing the entire db again from AX helped me get over the problem.

Steps i followed :
1.  Stop AOS
2. So go Sql Management Studio
3. Navigate to SQLSYNCInfo table, and delete the unwanted table records.
Alternatively, also truncating the entire table helps

SQL Management studio, run the following query on the DB

truncate table SQLSYNCINFO.

Thursday, January 9, 2014

SOLVED : Dynamics AX 2012 R2 CU7 Installation error / DMF

When I try to install CU7 on a CU6 environment, an error appears when the new models are being imported. Check the log and there is this message:

"Error updating model database: Microsoft.Dynamics.Setup.AxSetupException: AxUtil call returned errors:The model contains a customization of a configuration key. The model cannot be imported because you can overlayer a configuration key from the patching layer only. "

Installation guide for Cumulative Update 7 (link) also warns to uninstall DMF before upgrading to CU7. This is because CU7 has DMF already now a part of the AX installation after CU 7. So if you have DIXF/DIEF installed as the stand-alone package after it went out of beta and was renamed from DMF, you should delete the corresponding AX model.
CU7_DIEF1

When you try to install without removing the model you can certainly expect this error:
CU7_DIEF2
The log file will give you the next details:

"The model contains a customization of a configuration key. The model cannot be imported because you can overlayer a configuration key from the patching layer only."

Solution:
Uninstall DMF for CU6 from Control panel / axutil

axutil delete /model:"Data Import Export Framework" from CMD .
Reinstall CU7