Tuesday, December 20, 2011

Microsoft Dynamics AX 2012 - Technical Conference Fall Edition

From January 4th, 2012 at this link https://mbs.microsoft.com/partnersource/training/news/MSDYAX_TechConferenceFall.htm will be available all the session recordings and presentation content about AX 2012.


AX 2012 - Models, Layers, and the Model Store

Models and Model Store

Deploying Customizations and Solutions by using Models and the Model Store

Import\Export ModelStore

Model and model store cmdlets


Export-AXModel -Server SERVERDB -Database DataBaseName –Model "Model Name" -File c:\temp\xxxxx.axmodel

Install-AXModel -Server SERVERDB -Database DatabaseName -File c:\temp\xxxxx.axmodel -DETAILS -Conflict Overwrite

How to add or delete a label file in Dynamics AX 2012

For exporting all models from a single layer, you can use the following Powershell command (in the AX management shell):

$path = 'c:\Share'
Get-AXModel -Layer USR `
    | % {Export-AXModel -Model $_.Name -File (Join-Path $path "$($_.Name).axmodel") }
You have to update the path and the layer, of couse.

If you want Export models in sequence : AX 2012 – Export models in Sequence


Monday, December 19, 2011

SQL Server 2008 - CPU Usage

Below, a query due to verify the CPU Usage of Sql Server.
Finally, check also this link http://support.microsoft.com/kb/961811 related the orphaned session IDs.

SELECT TOP 500 (a.total_worker_time/a.execution_count) as [Avg_CPU_Time],
Convert(Varchar,Last_Execution_Time) as 'Last_execution_Time',
            (case when a.statement_end_offset = -1 then len(convert(nvarchar(max), b.text)) * 2
            a.statement_end_offset end - a.statement_start_offset)/2) as Query_Text,
b.objectid as 'Object_ID'
FROM sys.dm_exec_query_stats a
cross apply
sys.dm_exec_sql_text(a.sql_handle) as b
  [Avg_CPU_Time] DESC


AX 2012 - Add a new Financial Dimensions with the values linked to a Table


If you have to add a new Financial Dimensions with the values linked to a Table ( Setting an entity to be dimensionable  ) follow this steps :

To set an entity to be dimensionable, create a view as directed below. The entity will automatically appear as an available backing entity type.
Also, to integrate with the dimensions framework when deleting or renaming the natural key of the backing entity, you must write custom code on the backing table's delete method, and also on either the update or renamePrimaryKey method. See CustTable for an example of the pattern these methods must follow.

1. The view name must be DimAttribute[yourentityname]. For example, DimAttributeCustTable.
2. The view must contain a root data source named BackingEntity that points to your backing table to identify a surrogate key and natural key.
3. The view may optionally contain additional related data sources to handle inheritance or relational associations to provide additional fields, such as a name from the DirPartyTable.
4. The view must contain the following fields named exactly as follows:
• Key - Must point to the backing entity's SK field. For example, an int64 RecId field.
• Value - Must point to the backing entity's NK field. For example, a str30 AccountNum field.
• Name - Must point to the source of an additional description for the entity. For example, a str60 Description field.

Because the list of dimensionable entities are cached on both the client and server, the creation of a new dimensionable entity will not appear in the list of existing entities until a call to clear the caches is performed, or until both the client and the server are restarted. In order to clear the caches and have the new backing entity appear immediately, you must execute the following line of code within a job:

If a new Organization Model OMOperatingUnitType enumeration is added, the steps to make it dimensionable are similar but can be made shorter as follows: 31 IMPLEMENTING THE ACCOUNT AND FINANCIAL DIMENSIONS FRAMEWORK FOR MICROSOFT DYNAMICS AX 2012 APPLICATIONS

1. Copy one of the existing DimAttributeOM[entityname] views, rename it appropriately and adjust all associated labels and help text.
2. Expand the Datasource\BackingEntity (OMOperatingUnit)\Ranges node on the copied view and change the value property on the range to the new OMOperatingUnitType enumeration value that was just added.
Because the OMOperatingUnitType is backed by the OMOperatingUnit table, generic code already exists to handle the delete, update and renamePrimaryKey methods. Therefore, in this case, you do not need to update these methods.

Finally, due to activate the new Dimension read this blog http://www.intergen.co.nz/blog/tim-schofield/dates/2011/12/how-to-add-a-financial-dimension-in-ax-2012/

Enjoy !

Wednesday, December 14, 2011

Dynamics AX 2012 - Error during deployment SSRS Reports on the Second instance of SQL Reporting

On a server running multiple report server instance i have a error during SSRS Reports deployment.

I have run the command Test-AXReportServerConfiguration that return IsReportServerRunning : False

After a hard investigation ...without success, i have uninstall the second instance of Reporting Services and install again.
After that i have follow again the steps listed on TechNet page Install multiple instances of Reporting Services on the same computer (for use with Microsoft Dynamics AX) [AX 2012] (technet.microsoft.com/.../hh389760.aspx) and now all work fine.


Tuesday, November 29, 2011

Friday, November 25, 2011

AX 2012 - The Client Configuration don't have a valid WCF configuration

When you open AX 2012 and appear the error in the subject, you have open the Dynamics AX Configuration Utility, go to the tab Connection and Click on the Button "Configure Services" !!

After that the WCF Configuration comes rebuild.

Tuesday, October 25, 2011

AX 2009 and Visual Studio 2010 - Install Enterprise Portal Developer tools without enterprise portal

Out of the box EP Visual studio Add-in (Enterprise portal tools) shipped with AX2009 doesn't work with VS2010. With few simple steps it is possible to make it compatible. AX installer performs validation for VS2008 so all installations steps for Enterprise portal tools have to be done manually:

The same step more & less can be use for install Enterprise Portal Developer tools without install Enterprise Portal !

Copy DVD\MSI\EnterprisePortalTools to C:\Program Files\Microsoft Dynamics AX\50\EnterprisePortalTools
  1. Rename file Microsoft.Dynamics.Framework.Portal.VisualStudio.2008.AddIn.AddIn to Microsoft.Dynamics.Framework.Portal.VisualStudio.2010.AddIn.AddIn
  2. Edit the file: replace VS version 9.0 with 10.0
  3. Open VS2010: Tools->Options->Add-in/Macros security and add C:\Program Files\Microsoft Dynamics AX\50\EnterprisePortalTools
  4. Open DVD\MSI\Components64\
  5. Unpack AxWebProject.zip
  6. File ProjectName.webproj is just one bit big. For VS2010 it should be 0: either delete the file and create new one with same name or edit it and delete it's content
  7. Pack it back to AxWebProject.zip
  8. Create folder My Documents\Visual Studio 2010\Templates\ProjectTemplates\Visual Web Developer\CSharp
  9. Copy AxWebProject.zip to My Documents\Visual Studio 2010\Templates\ProjectTemplates\Visual Web Developer\CSharp
  10. Create folder My Documents\Visual Studio 2010\Templates\ItemTemplates\Visual Web Developer\CSharp
  11. Copy AxWebpartPage.zip and AxWebUserControl.zip from to My Documents\Visual Studio 2010\Templates\ItemTemplates\Visual Web Developer\CSharp
  12. Open VS2010 and make sure that EP project template is available
  13. To add EP specific Items to Visual Studio's Toolbox, select "Chose items" from the right click menu on VS's toolbox
  14. Browse for C:\Program Files\Microsoft Dynamics AX\50\Client\Bin\Microsoft.Dynamics.Framework.Portal.dll

Wednesday, May 25, 2011

Run Client Batches on Dynamics AX 2009

Here the steps to run Batch Job Client Side in Dynamics AX 2009 :

- First of all, modify the class and override the Method RunsImpersonated. Modify this method with Return False. In this way the Class will execute Client Side
- Create a Batch Group (Administration -> Setup -> Batch groups)
- Add this batch group to an AOS acting as batch server. (Administration -> Setup -> Server configuration)
- Start the batch client ( Basic -> Periodic -> Batch -> Processing )
- Select the new batch group and press 'OK'
- In the Server Configuration Form, verify that exists only AOS Instance really present. Delete all AOS Instance that don't exist.

Thursday, May 19, 2011

Dynamics AX 2009 EP - WebForm anyMarked method don't work

Problem :

Could happen that the anyMarked() method of a Webform Datasource don't work.

Solution :

Set the InsertAtEnd properties of the Datasource a NO

Dynamics AX 2009 Enterprise Portal - WebForm Lookup - Firefox, Google chrome, ect

In Dynamics AX 2009 EP, don't work lookup control on Firefox, Google Chrome, ect.It work only with Internet Explorer.

Cause :

Class WebFormHtml method showLookupButton.
This method in the Syp layer have introduce the keyword URLENCODE.
In the Sys layer instead is use the keyword Escape.

Solution :

Use sys layer code ( Keyword Escape ), so compare Sys with Syp and move the code present in Sys in the current layer ( Var, Usr, ect )

Monday, April 4, 2011

Retrieve Label from Enum Value

The follow codes is useful due to retrieve the label of TransType field related table InventTrans :

1. SysDictEnum dictEnum = new SysDictEnum( enumnum(InventTransType) );

2. dictEnum.value2Label(InventTrans.TransType)

Thursday, March 31, 2011

Unable to Login in Window Server 2008 in Terminal Server

Go in Secpol.msc - user rights assignments - allow logon through terminal services - Adding the Group or User that you want.

Thursday, March 24, 2011

SharePoint 2010 - Unable to do any operation on sharepoint rather than read only

Unable to do any operation on sharepoint rather than read only

This issue might be caused by backup failure

You may read here for details


 If the site collection’s Lock status is set to Not locked or Adding content prevented, Microsoft SharePoint Server 2010 temporarily sets the site to Read-Only while the backup operation is occurring. SharePoint Server 2010 does this to reduce the possibilities of users changing the site collection while it is being backed up. After the backup is finished, the setting is changed back its normal status

Tuesday, January 18, 2011

Downgrade Forms and Reports from AX 2009 to AX 4.0


If you export a Form or a Report from AX 2009 you can't import in AX 4.0. If you try compare a errore related Datasource Properties..
To fix the problem you have to open with Notepad the XPO and remove the follows two lines :

You can found this lines after the keyword OBJECTBANK after the keyword ENDMETHODS.

Wednesday, January 5, 2011

Code compare utility in MorphX on EP User controls

To enable the code compare utility in MorphX on EP user controls , edit the CodeIsSource method of SysTreeNode class in AOT and add UtilElmentType:WebControl and UtilElementType::WebSourceFile to the switch statement that returns true. After making the change, you shoudl be able to do code compare on user control markup and code behind files.


Welcome to the MCT Program

From Today I'm an MCT Trainer in Dynamics AX.