Showing posts with label Management Reporter 2012. Show all posts
Showing posts with label Management Reporter 2012. Show all posts

Wednesday, November 1, 2017

Management Reporter scripts

Few scripts that can be used to check the MR integration tasks:

Check all integration tasks that have been executed:

--List details about each DDM task: state, progress, last...
--List details about each DDM task: state, progress, last/next runtime in local time, and the interval that each runs 
--Status 5=Success; 3=Running; 6=Cancelled
select CIG.[Description] 
, STK.[Name] 
, STS.[Progress] 
, CASE STS.[StateType]  
WHEN 3 THEN 'Processing' 
WHEN 5 THEN 'Complete' 
WHEN 7 THEN 'Error' 
END AS StateType
, DATEADD(minute, DATEDIFF(minute,GETUTCDATE(),GETDATE()), STS.[LastRunTime]) as LocalLastRunTime 
, DATEADD(minute, DATEDIFF(minute,GETUTCDATE(),GETDATE()), STS.[NextRunTime]) as LocalNextRunTime 
, CM.[ContinueOnRecordError] 
, STRG.[Interval] 
, CASE STRG.[UnitOfMeasure] 
WHEN 2 THEN 'Minutes' 
ELSE 'Seconds' 
END AS IntervalTiming
, CASE STRG.[IsEnabled] 
WHEN 1 THEN 'Enabled' 
ELSE 'Disabled' 
END AS NameStatus
from [Connector].[Map] CM with (nolock) 
inner join [Scheduling].[Task] STK with (nolock) on STK.[Id] = CM.[MapId] 
inner join [Scheduling].[TaskState] STS with (nolock) on STK.[Id] = STS.[TaskId] 
inner join [Connector].[IntegrationGroup] CIG with (nolock) on CIG.[IntegrationId] = STK.[CategoryId] 
inner join [Scheduling].[Trigger] STRG with (nolock) on STK.[TriggerId] = STRG.[Id] 
order by CIG.[Description], STK.[Name]


Check the tasks outcomes

select CIG.[Description], ST.[Name], SM.[Text], 
DATEADD(minute, DATEDIFF(minute,GETUTCDATE(),GETDATE()), SL.[StartTime]) as LocalStartTime, 
DATEADD(minute, DATEDIFF(minute,GETUTCDATE(),GETDATE()), SL.[EndTime]) as LocalEndTime, 
SL.[TotalRetryNumber], SL.[IsFailed], STT.[Name] as TaskType 
from [Scheduling].[Log] SL with (nolock) 
inner join [Scheduling].[Task] ST with (nolock) on SL.TaskId = ST.Id 
inner join [Scheduling].[Message] SM with (nolock) on SL.Id = SM.LogId 
inner join [Scheduling].[TaskType] STT with (nolock) on ST.TypeId = STT.Id 
inner join [Connector].[IntegrationGroup] CIG with (nolock) on CIG.[IntegrationId] = ST.[CategoryId] 
order by SL.[StartTime] desc


Check the current integration activities

SELECT sqltext.TEXT, 
req.session_id, 
req.status, 
req.command, 
req.cpu_time, 
req.total_elapsed_time 
FROM sys.dm_exec_requests req 
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext

Wednesday, August 6, 2014

Management reporter config files

To enable logging:

  • Browse to (C:\Program Files\Microsoft Dynamics ERP\Management Reporter\2.1\Server\Services)
  • Open the "MRServiceHost.exe.config" file in Notepad. 
  • At the bottom of the file you will see the following line.
    <switches>
    <add name="Microsoft.Dynamics.Integration.TraceLog" value="0"/>
    </switches>
    Change the value to 4

To increase the integration time-out:
  • Browse to (C:\Program Files\Microsoft Dynamics ERP\Management Reporter\2.1\Server\Services) 
  • Open the "MRServiceHost.settings.config" file in Notepad
  • Change the IntegrationReaderTimeout to a greater value, or put 0 - which means no time-out



Monday, December 9, 2013

Management Reporter 2012 RU6, CU7 integration issue causing TempDb size to blow

In Management reporter 2012, starting from RU6, Microsoft introduces customer and vendor attributes, however under some circumstances this might cause the TempDb size to blow out.

The SQL query that causes the issue is:
set dateformat mdy;
SELECT COUNT(DISTINCT GJAE.RECID) FROM (SELECT
GJAE.RECID, GJAE.Partition as Partition, GJAE.TRANSACTIONCURRENCYAMOUNT, GJAE.ACCOUNTINGCURRENCYAMOUNT, GJAE.REPORTINGCURRENCYAMOUNT,
                                  GJAE.QUANTITY, GJAE.ISCREDIT, GJAE.TRANSACTIONCURRENCYCODE, C.TXT AS CURRENCYNAME, C.SYMBOL AS CURRENCYSYMBOL, GJAE.PAYMENTREFERENCE, GJAE.POSTINGTYPE, GJAE.TEXT,
                                  GJAE.GENERALJOURNALENTRY, GJAE.REASONREF, GJAE.LEDGERDIMENSION,
                                  GJE.ACCOUNTINGDATE, GJE.JOURNALNUMBER, GJE.POSTINGLAYER, GJE.LEDGER, GJE.FISCALCALENDARPERIOD, GJE.ACKNOWLEDGEMENTDATE,
                                  GJE.DOCUMENTDATE, GJE.LEDGERPOSTINGJOURNAL, GJE.DOCUMENTNUMBER, GJE.JOURNALCATEGORY,
                                  DALVV.DIMENSIONATTRIBUTE, DALVV.DISPLAYVALUE, DALVV.ENTITYINSTANCE,
                                  RTR.REASON, RTR.REASONCOMMENT,
                                  LE.CONSOLIDATEDCOMPANY, LE.ISBRIDGINGPOSTING, MA.AccountCategoryRef, VDPT.NAME as VENDORNAME, CDPT.NAME as CUSTOMERNAME,
                                  LJT.NAME as JOURNALDESCRIPTION, LJT.JOURNALTYPE, LJT.JOURNALNAME,
                                  GJE.SUBLEDGERVOUCHER, TRT.TRACENUM, TRT.REVERSED, LJTR.REVERSEENTRY, NULL as MODIFIEDDATETIME, NULL as MODIFIEDBY, LJT.POSTEDDATETIME as JOURNALENTRYDATE, NULL as HISTORICALEXCHANGERATEDATE
FROM GENERALJOURNALACCOUNTENTRY GJAE
                           left outer join GENERALJOURNALENTRY GJE on GJAE.GENERALJOURNALENTRY = GJE.RECID
                           left outer join DIMENSIONATTRIBUTELEVELVALUEVIEW DALVV on GJAE.LEDGERDIMENSION = DALVV.VALUECOMBINATIONRECID
                           left outer join REASONTABLEREF RTR on GJAE.REASONREF = RTR.RECID
                           left outer join LEDGERENTRY LE on GJAE.RECID = LE.GENERALJOURNALACCOUNTENTRY
                           left outer join LEDGERENTRYJOURNAL LEJ on GJE.LEDGERENTRYJOURNAL = LEJ.RECID
                           left outer join LEDGERJOURNALTABLE LJT on LEJ.JOURNALNUMBER = LJT.JOURNALNUM
                           left outer join CURRENCY C on GJAE.TRANSACTIONCURRENCYCODE = C.CURRENCYCODE and C.Partition = GJAE.Partition
                           left outer join VENDTRANS VTR on GJE.SUBLEDGERVOUCHER = VTR.VOUCHER and GJE.DOCUMENTDATE = VTR.DOCUMENTDATE
                           left outer join VENDTABLE VTA on VTR.ACCOUNTNUM = VTA.ACCOUNTNUM
                           left outer join DIRPARTYTABLE VDPT on VTA.PARTY = VDPT.RECID
                           left outer join CUSTTRANS CTR on GJE.SUBLEDGERVOUCHER = CTR.VOUCHER and GJE.DOCUMENTDATE = CTR.DOCUMENTDATE
                           left outer join CUSTTABLE CTA on CTR.ACCOUNTNUM = CTA.ACCOUNTNUM
                           left outer join DIRPARTYTABLE CDPT on CTA.PARTY = CDPT.RECID
                           left outer join TRANSACTIONREVERSALTRANS TRT on GJAE.RECID = TRT.REFRECID and TRT.REFTABLEID = 3119
                           left outer join LEDGERJOURNALTRANS LJTR ON LJTR.REVERSEENTRY = 1 AND GJE.SUBLEDGERVOUCHER = LJTR.VOUCHER AND GJE.ACCOUNTINGDATE = LJTR.TRANSDATE
                           left join DIMENSIONATTRIBUTE DA ON DA.RECID = DALVV.DIMENSIONATTRIBUTE
                           left join MAINACCOUNT MA on MA.RECID = DALVV.ENTITYINSTANCE AND DA.TYPE = 2  LEFT OUTER JOIN CHANGETABLE(CHANGES GENERALJOURNALACCOUNTENTRY, 0) GJAE_CT ON GJAE.RECID = GJAE_CT.RECID
 LEFT OUTER JOIN CHANGETABLE(CHANGES GENERALJOURNALENTRY, 0) GJE_CT ON GJE.RECID = GJE_CT.RECID
 LEFT OUTER JOIN CHANGETABLE(CHANGES LEDGERJOURNALTABLE, 0) LJT_CT ON LJT.JOURNALNUM = LJT_CT.JOURNALNUM
 LEFT OUTER JOIN CHANGETABLE(CHANGES LEDGERJOURNALTRANS, 0) LJTR_CT ON LJTR.RECID = LJTR_CT.RECID
) GJAE WHERE GJAE.POSTINGTYPE <> 19


As you can see the query does not consider partition or dataAreaId when do the joins to the CustTable, CustTrans, VendTable, and VendTrans. Depending what kind of data you have, this might cause the TempDb size to blow out of the proportion.

In our case I had a 169GB AX database, and the TempDb size blew to over 500GB because of this query. The database does have a lot of customers and vendors using the same account numbers across 130+ companies.

I was told to use Management reporter RU5 instead, where it doesn't have any customer and vendor attributes, and that worked fine.

Sunday, December 23, 2012

Management Reporter 2012 RU3 with Dynamics AX 2012 - failed integration due to dimension totalling function

I've just recently done an installation of recently released Management Reporter 2012 RU3 with Dynamics AX 2012 CU3 using DataMart and has bumped into a known Management Reporter issue.

The issue will prevent Management Reporter to actually complete the initial integration with Dynamics AX 2012. If I take a look at the DataMart integration log, there is an error entry that says:
[AX 2012 Dimension Values to Dimension Value] has encountered an error. Processing will be aborted. Error text: Exception of type 'Microsoft.Dynamics.Integration.Service.Tasks.IncompleteResultException' was thrown.

Basically this version of Management Reporter cannot work together with a feature in Dynamics AX 2012 to "calculate total from multiple dimension values". You can check this from GL > Setup > Financial Dimensions  > Financial dimension values [button]. Please note that all the dimension values must not have the "calculate total from multiple dimension values" checkbox ticked and also there should not be any totals set up for any of the dimension values.

You can run this SQL script to check if you might have the issue:
select DIMENSIONATTRIBUTEVALUE, COUNT(DIMENSIONATTRIBUTEVALUE) as DimCount 
from DIMENSIONATTRIBUTEVALUETOTALLINGCRITERIA 
group by DIMENSIONATTRIBUTEVALUE 
order by DimCount desc 

If you have any entry with DimCount greater than 1, then you'll have the integration issue with this Management Reporter.

To solve the issue, you need to make sure that all of the dimension values have the "calculate total from multiple dimension values" checkbox un-ticked and you have no entry in DimensionAttributeValueTotallingCriteria table.
I have been told that the issue only affects the initial integration between Management Reporter and Dynamics AX 2012, meaning you should be able to use the dimension value totalling function from AX once you've done the initial integration.