Management Reporter – Integration error – Primary Key – PK_PeriodsByDate

Found an error in the management reporter integration logs, reporting a duplicate primary key ‘PK_PeriodsByDate’.

The problem turned out to be a duplicate record in the datamart periodstaging table.

select datediff(day,starts,ends) as ‘days’,* from datamart.periodstaging
where datediff(day,starts,ends) > 31

Using the above SQL code it found a record with more than 31 days. There was a duplicate record for January, one for the month, and one for the whole year.

delete from datamart.periodstaging where datediff(day,starts,ends) > 31

Deleting the record from the periodstaging table resolved the integration error.


Found a continuing problem with the date data in the MR datamart.

The period table also had the opening transaction from January through December present. using the following will find and delete the entries.

select datediff(day,starts,ends) as ‘days’,* from datamart.[Period]
where datediff(day,starts,ends) > 31

delete from datamart.[Period] where datediff(day,starts,ends) > 31

Create User License Batch Job

If you ever need to re-create the system standard user license batch job, this can be completed using the following lines of code, in a job.

To create the Automatical Role Assignement batch job use:

SysSecurityDynamicRoleAssignment::createBatchJob();

To create the user licnese miner batch job user:

SysUserLicenseMiner::createBatchJob();

Error when installing Reporting Extensions – Version Str

Recently I encountered an issue when installing reporting extensions.

An error occurred during setup of Reporting Services extensions.
Reason: Version string portion was too short or too long.
System.ArgumentException: Version string portion was too short or too long.
    at System.Version..ctor(String version)
    at Microsoft.Dynamics.AX.Framework.Reporting.Shared.SrsWmi.get_ReportManagerUrl()
    at Microsoft.Dynamics.Setup.ReportsServerInstaller.GetOrCreateServerConfiguration(String instanceName, String sharePointServiceApplicationSite, Boolean& createdConfiguration)
    at Microsoft.Dynamics.Setup.Components.ReportingServicesExtensions.InstallConfigurationFiles(String instanceName, String sharePointServiceApplicationSite, Boolean& createdConfiguration)
    at Microsoft.Dynamics.Setup.Components.ReportingServicesExtensions.RunReportingSetupManagerDeploy()

Continue reading