No worries. I still think I can take what you built and make a tool that will save me a lot of debugging time.
I wonder if you can see the server side Epicor logs or if they even use 'em for Cloud clients. We’re not MT so can do some custom code, I think there are still some restrictions, but this could work for us.
This will work in the cloud as long as you can use custom code.
Ice.Diagnostics.Log.WriteEntry(“Your Message”); is available in “Epicor App Server”
Here is the actual Event Logs You have access to: (Use the “Log” Name for the EventLogName)
Log: Application DisplayName: Application MinRetention: 0 MaxKB: 20480
Log: Epicor App Server DisplayName: Epicor App Server MinRetention: 7 MaxKB: 512
Log: Epicor ICE Task Agent Service DisplayName: Epicor ICE Task Agent Service MinRetention: 7 MaxKB: 10240
Log: Epicor Software Corporation Client Log DisplayName: Epicor Software Corporation Client Log MinRetention: 7 MaxKB: 4194240
Log: HardwareEvents DisplayName: Hardware Events MinRetention: 0 MaxKB: 20480
Log: Internet Explorer DisplayName: Internet Explorer MinRetention: 7 MaxKB: 512
Log: Key Management Service DisplayName: Key Management Service MinRetention: 0 MaxKB: 20480
Log: Operations Manager DisplayName: Operations Manager MinRetention: 0 MaxKB: 15360
Log: Qualys DisplayName: Qualys MinRetention: 7 MaxKB: 10
Log: System DisplayName: System MinRetention: 0 MaxKB: 20480
Log: Windows Azure DisplayName: Windows Azure MinRetention: 7 MaxKB: 512
Log: Windows PowerShell DisplayName: Windows PowerShell MinRetention: 0 MaxKB: 15360
This is awesome. Just loaded it up on our Pilot DB.
When I get some free time, I’ll upload an updated version with the Event Log as a dropdown combo with what you have access to.
Update for Dropdown modification:
Edit: First post updated above.
Here are the two files that changed:
The customization on the dashboard, and an additional query.
Files from original post
App.KEV_EventLog.MainController_Customization_EventLogV1_CustomExport.xml (285.6 KB)
KEV_EventLogList.baq (20.3 KB)
Query Info:
/*
* Disclaimer!!!
* This is not a real query being executed, but a simplified version for general vision.
* Executing it with any other tool may produce a different result.
*/
select
(null) as [Calculated_EventLogName],
(null) as [Calculated_DisplayName]
Query Code on GetList:
string retString = "";
string nl = Environment.NewLine;
result.Results.Clear();
//No reference available in "Usings & References - Assemblies", so we will load by reflection.
Assembly System_Diagnostics_EventLog = Assembly.Load("System.Diagnostics.EventLog");
Type typeEventLog = System_Diagnostics_EventLog.GetType("System.Diagnostics.EventLog");
MethodInfo methodGetEventLogs = typeEventLog.GetMethods().FirstOrDefault
(method => method.Name == "GetEventLogs"
&& method.GetParameters().Count() == 0);
IEnumerable<dynamic> eventLogs = (dynamic)methodGetEventLogs.Invoke(null, null);
List<ResultsUbaqRow> logRange = new List<ResultsUbaqRow>();
foreach(dynamic item in eventLogs)
{
try
{
//retString += $"Log: {item.Log.PadRight(40)} DisplayName: {item.LogDisplayName.PadRight(40)} MinRetention: {item.MinimumRetentionDays.ToString().PadRight(40)} MaxKB: {item.MaximumKilobytes.ToString().PadRight(40)} \n";
logRange.Add(new ResultsUbaqRow
{
Calculated_EventLogName = item.Log,
Calculated_DisplayName = item.LogDisplayName,
SysRowID = Guid.NewGuid(),
RowIdent = DateTime.Now.Ticks.ToString(),
RowMod = "A",
});
}
catch(Exception ex)
{
//Trying to read from "Security" Event Log, or another you do not have access to...
if(ex is System.Security.SecurityException)
{
//retString += ex.Message + nl;
}
}
}
result.Results.AddRange(logRange);
//if(!string.IsNullOrEmpty(retString)) InfoMessage.Publish(retString);
Can you have the LIKE ‘[.]NET’ and that period should stay and only give .NET items? Only way I found to get the [-] to work properly
I don’t understand. Maybe I need more coffee.
Was probably me I misread and my suggestion would only work if that was converted to SQL not under C# Similar to your idea [dot] could have been a trigger versus but after looking @ your code please disregard my earlier suggestion. Not sure would escaping the dot help like: \.NET
Yeah, that’s what I tried first before realizing what was going on.
Do widgets with custom code work on SaaS MT or is that also prohibited on MT?
TBH I’m still trying to wrap my head around the various offerings and what they mean as far as features.
If you’re truly SaaS MT, then no code widgets. If you are regular Public Cloud/Dedicate Tenant, then you will have code widgets. MT hasn’t been sold to customers in several years, so if you’re new-ish you’re probably not MT.
The main difference is that in MT, multiple companies are in one database and code would be able to reach other customers. In Public Cloud, only one customer per database.
I kinda thought that was the case, but as you all mentioned earlier, that information was from a last week’s problem.
We are a public cloud customer so we have the option of custom code and widgets with custom code, it’s more just curiosity and trying to remember as much as possible.
Is there a way to have this in a BAQ Report?
I’d have to think it through but probably.
I was thinking to use it to track and keep the data of deleted records since we can use BPM to log information to server.
As Epicor Changelog isn’t adapt at tracking delete at all…I use CDC Log for on-prem server but currently on Cloud I cannot pull the CDC logs from BAQ or access the SQL…
So I figured. Use the Data Directive BPM to set the table to log message to the server for the record that was deleted. Inside the log message, Insert the table query for all the table fields.
In the Dashboard when I filter out the log event for that BPM I was able to get as per the sample below.
So then, if its possible to put this in the BAQ Report, I can have it periodically send an email to the set admin/user so there is a record of their own for deleted records.
Though if not, this Dashboard still works great! You have no idea how happy I was when I found this!
You can do BPMs and write to a UD table as a makeshift CDC log for Epicor.
I did see that people mention that you can use BPM but they don’t specify how to do it exactly and as I mentioned, I am not well-versed i coding…Not to mention this means each different table I would need to have it coded differently to pull different fields…at least to my knowledge.
The one example that I did find was coded for only 1 table which was the PO table if I remember right. And it was for logging specific fields to the UD table for that 1 table…
With the help of this dashboard and the BPM to log the deleted record, I can have the BPM done with any tables and with no coding or extra UD tables and able to view deleted data.
Though if there is a bpm that standardized for all deleted table, I am open to it too
Personally I would go the BPM log route for this. If you would like, start a new thread on it,
and we will teach you. Or perhaps someone will come along with something better.