Track CLOUD Classic Dashboard Usage

I’ve got a few cloud clients who are have been on classic for a decade, are on the cloud, and looking forward (?) to the classic sunset next year. Part of the issue is they’ve got tens/hundreds of dashboards on their menus, but really no idea what the users are actually using. Of course, if you ask, they’ll say they need all of them.

I put together the following BPM that captures every time someone gets into a dashboard from the menu into a CSV file out in the server folder. My plan is to let this run for 60-90 days, and we’ll find out which dashboards are actually being used.

The BPM is a Post-Processing directive on the BOReader.GetList method, with a condition of "the serviceNamespace argument/variable is equal to the “ICE:BO:DASHBOARD” expression. If that evaluates true, it executes this custom code:

string OutLine = "Company,UserID,TimeStamp,DashboardID\n";
string dashboardID = string.Empty;
string outputDir  = @"DashboardLogs";
string outputFile = @"DashboardLogs\DashboardAccess" + DateTime.Today.ToString("yyMM") + ".txt";

//   Check for File Path in Company Folder.  If it doesn't exist, create it. 
var filePathD = new FilePath(ServerFolder.CompanyData, outputDir);
if ( ! this.Sandbox.IO.Directory.Exists(filePathD) ) 
{
  try {  this.Sandbox.IO.Directory.CreateDirectory(filePathD);  }
  catch {
  }
}

//  Create File Name.  If it doesn't exist, create it with header line. 
var filePathF = new FilePath(ServerFolder.CompanyData, outputFile);
if ( ! this.Sandbox.IO.File.Exists(filePathF) ) 
{
    try { this.Sandbox.IO.File.AppendAllText(filePathF, OutLine ); }
    catch {}
}

//  Extract Dashboard from whereClause and write data to log file
OutLine = Session.CompanyID + "," + Session.UserID + "," + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ",";
try
{
   dashboardID = whereClause.SubString(16,100);
   dashboardID = dashboardID.SubString(0, dashboardID.Length - 1);
   OutLine += dashboardID + "\n";
}
catch {
   OutLine += whereClause + "\n";
}
this.Sandbox.IO.File.AppendAllText(filePathF, OutLine );

This writes/appends to a file that can be downloaded using the System Management->Schedule Processes->Server File Download utility. You’ll get a CSV file with the Company ID, User ID, Date/Time Stamp and the Dashboard ID.

Of course, please test and use at your own risk.

2 Likes

Why not use activity tracking?

2 Likes

It’s a handy tool, just don’t set your dates to too wide a range. I have also noticed if you enable then disable. The data collected the first time you enabled does not seem to get purged. Had 10 gigs worth of logs that we had to clean out.

Good point. Probably could put a date parameter on the condition statement.

Also, if you’ll note, it creates a new log file each month, as the month/year are part of the file name. So, worse case - the files have only one month’s of data in them. I believe in the cloud, Epicor runs purge of these files on a regular basis, so they shouldn’t hang around too long anyway.

1 Like

Alisa,

To start with, didn’t know it was there! I’ll have to check it out!

It doesn’t look like dashboard is an option, so might have to play with and see if BAQ catches it (then circle back to the dashboard from there). Otherwise, looks like I could track by Menu ID.

Thanks!

Dashboards are captured under menu id type activity.

@aosemwengie1 has the right idea here. Enable the activity types and set logging for a few months. I wrote a baq to summarize this by user, would really like to summarize by role or user security group.

2 Likes