Skip to content

Instantly share code, notes, and snippets.

@jofme
Created September 2, 2024 18:32
Show Gist options
  • Save jofme/5c42408b345fb70d9218c0ef05da26fb to your computer and use it in GitHub Desktop.
Save jofme/5c42408b345fb70d9218c0ef05da26fb to your computer and use it in GitHub Desktop.
1.7.0.0 Release built on 10.0.0.41 - sendTelemetryAssignedExpiredRevoked
// Dynamics.AX.D365FOAdminToolkit.0.netmodule
// Dynamics.AX.Application.ADMSysAdminLogHelper
using System.Runtime.InteropServices;
using Microsoft.Dynamics.Ax.Xpp;
using Microsoft.Dynamics.AX.XppExecutionTraces;
public static void `sendTelemetryAssignedExpiredRevoked([In] string _id, [In] string _name, [In] ADMSysAdminLog _sysAdminLog)
{
bool flag = false;
try
{
Microsoft_Dynamics_AX_XppExecutionTraces.WriteEventXppMethodEnter("xppSource://Source/D365FOAdminToolkit\\AxClass_ADMSysAdminLogHelper.xpp", "Dynamics.AX.Application.ADMSysAdminLogHelper::sendTelemetryAssignedExpiredRevoked", 70u);
flag = ManagedSessionState.EnterPublisherScope("class:ADMSysAdminLogHelper.sendTelemetryAssignedExpiredRevoked", 44, "D365FO Admin Toolkit");
XppPrePostArgs val = default(XppPrePostArgs);
object obj2;
if ($sendTelemetryAssignedExpiredRevoked_PreDelegate != null || $sendTelemetryAssignedExpiredRevoked_PostDelegate != null)
{
val = new XppPrePostArgs((object)null);
if ($sendTelemetryAssignedExpiredRevoked_PreDelegate != null)
{
val.addArg("_id", (object)_id);
val.addArg("_name", (object)_name);
val.addArg("_sysAdminLog", (object)_sysAdminLog);
$sendTelemetryAssignedExpiredRevoked_PreDelegate.Invoke(val);
_id = CastHelper.ObjectToString(val.getArg("_id"));
_name = CastHelper.ObjectToString(val.getArg("_name"));
object obj = CastHelper.ObjectToCommon(val.getArg("_sysAdminLog"));
if (obj != null && (object)obj.GetType() != typeof(Common))
{
obj = ((obj is Common) ? obj : null);
if (obj != null)
{
obj2 = (ADMSysAdminLog)(object)((Common)obj).GetMapTable();
goto IL_00f7;
}
}
obj2 = new ADMSysAdminLog();
((Common)obj2).SetNullCursor();
goto IL_00f7;
}
}
goto IL_00fd;
IL_00fd:
if (TrueFalseHelper.TrueFalse(CheckTelemetrySysAdminRole()))
{
SysApplicationInsightsTelemetryLogger.instance().trackEvent((SysApplicationInsightsEventTelemetry)((SysApplicationInsightsTelemetryContractBase)SysApplicationInsightsEventTelemetry.newFromEventIdName(_id, _name)).addProperty((SysApplicationInsightsProperty)(object)ADMApplicationInsightsSysAdminUserIdProperty.newFromValue(_sysAdminLog.UserId_)).addProperty((SysApplicationInsightsProperty)(object)ADMApplicationInsightsSysAdminReasonProperty.newFromValue(_sysAdminLog.Reason)).addProperty((SysApplicationInsightsProperty)(object)ADMApplicationInsightsSysAdminFromDateTimeProperty.newFromValue(DateTimeUtil.toStr(((Common)_sysAdminLog).createdDateTime)))
.addProperty((SysApplicationInsightsProperty)(object)ADMApplicationInsightsSysAdminToDateTimeProperty.newFromValue(DateTimeUtil.toStr(_sysAdminLog.EndDateTime))));
}
if ($sendTelemetryAssignedExpiredRevoked_PostDelegate != null)
{
val.setArg("_id", (object)_id);
val.setArg("_name", (object)_name);
val.setArg("_sysAdminLog", (object)_sysAdminLog);
val.setCalledWhen((XppEventHandlerCalledWhen)1);
$sendTelemetryAssignedExpiredRevoked_PostDelegate.Invoke(val);
}
return;
IL_00f7:
_sysAdminLog = (ADMSysAdminLog)obj2;
goto IL_00fd;
}
finally
{
Microsoft_Dynamics_AX_XppExecutionTraces.WriteEventXppMethodExit("xppSource://Source/D365FOAdminToolkit\\AxClass_ADMSysAdminLogHelper.xpp", "Dynamics.AX.Application.ADMSysAdminLogHelper::sendTelemetryAssignedExpiredRevoked", 70u);
if (flag)
{
ManagedSessionState.LeavePublisherScope("class:ADMSysAdminLogHelper.sendTelemetryAssignedExpiredRevoked", 44, "D365FO Admin Toolkit");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment