Dashboard Usage Tracking

adminUncategorized

If you approaching an upgrade, it is a good time to consider whether all the dashboards that have been created, need to come across.

In order to do this, the best way is to audit dashboard usage and then decide a threshold number for bringing the dashboard across.

Epicor do provide an extended solution for tracking menu usage, but it is possible to create your own using a UD table and a post processing method directive on the ‘Ice.DashBoard.GetDashboardVersionInTenant‘ method.

This post will present a run through of creating the BPM.

Firstly you need to decide which UD table you are going to use. This post assumes you are going to use the UD13 table.

Next it is time to create the method directive.

  • Create the following variables:
    • Key1 – string
    • Number20 – integer
    • ModuleName – string
    • tsUD13 – UD13 tableset
  • Condition – Create a condition that checks for the phrase code ‘CodeBehind’. If the condition returns ‘False’ then proceed to the next stage.
  • Custom Code – In order to insert a record it is necessary to create a unique identifier for the key value. The code below does this by looking at the last value in the Number20 field in the UD13 table and adds 1. The code also assigns the ‘definitionid’ to the module name

    int maxSeq = (int)(from u in Db.UD13.With(LockHint.NoLock)
        where u.Company == Session.CompanyID
        select u.Number20).DefaultIfEmpty(1000000).Max() + 1;
        
    if (maxSeq != null)
    {
        Number20 = maxSeq; // Stores our Counter in Decimal
        Key1 = Convert.ToString((int) Number20); 
    }
      
    ModuleName = definitionID;
    
  • Invoke BO Method – Invoke the UD13.GetaNewUD13 method passing the tsUD13 as the parameter.
  • Update Table By Query
    • Query – Create a query with just the tsUD13 recordset selected and select the sysRowID
    • to update all rows of the tsUD13.UD13 table
    • with the configured mapping
      • Relations – tsUD13.UD13.SysRowID = Query SysRowID
      • Bindings
        • Key1 = Key1
        • Key2 = “”
        • Key3 = “”
        • Key4 = “”
        • Key5 = “”
        • Character01 = ModuleName
        • Character02 = callContextClient.CurrentUserID
        • Date01 = BPMFunc.Today
  • Invoke BO Method – Invoke the ‘UD13.Update’ method passing the usUD13 parameter
The finished BPM

A simple SQL query such as

SELECT COUNT(*), character01 FROM EpicorERP.Ice.UD13 GROUP BY character01 ORDER BY 1 DESC

will provide you with a summary of the amount times a dashboard has been called during a specified.

Based on your threshold you can archive off a number of dashboard and delete them prior to an upgrade and thus reduce the amount of testing.