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.