Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ VisualStudioVersion = 17.8.34322.80
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FC65038C-1B2F-41E1-A629-BED71D161FFF}") = "Order2Cash (USR) [FTApplicationInsightsTelemetry]", "Order2Cash\Order2Cash.rnrproj", "{A24B055C-A29A-4198-AA06-F62C9471F635}"
EndProject
Project("{FC65038C-1B2F-41E1-A629-BED71D161FFF}") = "TelemetryExtensionExample (SYS) [Application Suite]", "TelemetryExtensionExample\TelemetryExtensionExample.rnrproj", "{7A2363FB-28BD-4203-BDDC-661CC58FBC68}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A24B055C-A29A-4198-AA06-F62C9471F635}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A24B055C-A29A-4198-AA06-F62C9471F635}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A2363FB-28BD-4203-BDDC-661CC58FBC68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A2363FB-28BD-4203-BDDC-661CC58FBC68}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<BuildTasksDirectory Condition=" '$(BuildTasksDirectory)' == ''">$(MSBuildProgramFiles32)\MSBuild\Microsoft\Dynamics\AX</BuildTasksDirectory>
<Model>Foundation</Model>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<OutputPath>bin</OutputPath>
<SchemaVersion>2.0</SchemaVersion>
<GenerateCrossReferences>True</GenerateCrossReferences>
<RunAppCheckerRules>False</RunAppCheckerRules>
<LogAppcheckerDiagsAsErrors>False</LogAppcheckerDiagsAsErrors>
<DeployOnline>False</DeployOnline>
<ProjectGuid>{7a2363fb-28bd-4203-bddc-661cc58fbc68}</ProjectGuid>
<Name>TelemetryExtensionExample</Name>
<RootNamespace>TelemetryExtensionExample</RootNamespace>
<StartupType>Class</StartupType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<Configuration>Debug</Configuration>
<DBSyncInBuild>False</DBSyncInBuild>
<GenerateFormAdaptors>False</GenerateFormAdaptors>
<Company>
</Company>
<Partition>initial</Partition>
<PlatformTarget>AnyCPU</PlatformTarget>
<DataEntityExpandParentChildRelations>False</DataEntityExpandParentChildRelations>
<DataEntityUseLabelTextAsFieldName>False</DataEntityUseLabelTextAsFieldName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<ItemGroup>
<Content Include="AxClass\DMFDefinitionGroupExecutionHistory_Extension">
<SubType>Content</SubType>
<Name>DMFDefinitionGroupExecutionHistory_Extension</Name>
<Link>DMFDefinitionGroupExecutionHistory_Extension</Link>
</Content>
<Content Include="AxClass\MyApplicationInsightsEventIds">
<SubType>Content</SubType>
<Name>MyApplicationInsightsEventIds</Name>
<Link>MyApplicationInsightsEventIds</Link>
</Content>
<Content Include="AxClass\MyApplicationInsightsEventNames">
<SubType>Content</SubType>
<Name>MyApplicationInsightsEventNames</Name>
<Link>MyApplicationInsightsEventNames</Link>
</Content>
<Content Include="AxClass\MyApplicationInsightsEventProperties">
<SubType>Content</SubType>
<Name>MyApplicationInsightsEventProperties</Name>
<Link>MyApplicationInsightsEventProperties</Link>
</Content>
<Content Include="AxClass\MyApplicationInsightsProperty">
<SubType>Content</SubType>
<Name>MyApplicationInsightsProperty</Name>
<Link>MyApplicationInsightsProperty</Link>
</Content>
<Content Include="AxClass\MySysIntParametersFormEventHandler">
<SubType>Content</SubType>
<Name>MySysIntParametersFormEventHandler</Name>
<Link>MySysIntParametersFormEventHandler</Link>
</Content>
<Content Include="AxClass\MyTelemetryBase">
<SubType>Content</SubType>
<Name>MyTelemetryBase</Name>
<Link>MyTelemetryBase</Link>
</Content>
<Content Include="AxClass\TelemetryDataManagementImport">
<SubType>Content</SubType>
<Name>TelemetryDataManagementImport</Name>
<Link>TelemetryDataManagementImport</Link>
</Content>
<Content Include="AxClass\TelemetryPurchaseOrderConfirm">
<SubType>Content</SubType>
<Name>TelemetryPurchaseOrderConfirm</Name>
<Link>TelemetryPurchaseOrderConfirm</Link>
</Content>
<Content Include="AxClass\TelemetrySalesOrderConfirm">
<SubType>Content</SubType>
<Name>TelemetrySalesOrderConfirm</Name>
<Link>TelemetrySalesOrderConfirm</Link>
</Content>
<Content Include="AxClass\TelemetryShipConfirm">
<SubType>Content</SubType>
<Name>TelemetryShipConfirm</Name>
<Link>TelemetryShipConfirm</Link>
</Content>
<Content Include="AxClass\WhsShipConfirm_Extension">
<SubType>Content</SubType>
<Name>WhsShipConfirm_Extension</Name>
<Link>WhsShipConfirm_Extension</Link>
</Content>
<Content Include="AxEdt\MyTelemetryClass">
<SubType>Content</SubType>
<Name>MyTelemetryClass</Name>
<Link>MyTelemetryClass</Link>
</Content>
<Content Include="AxEnum\MyTelemetrySeverityLevel">
<SubType>Content</SubType>
<Name>MyTelemetrySeverityLevel</Name>
<Link>MyTelemetrySeverityLevel</Link>
</Content>
<Content Include="AxFormExtension\SysIntParameters.MyExtension">
<SubType>Content</SubType>
<Name>SysIntParameters.MyExtension</Name>
<Link>SysIntParameters.MyExtension</Link>
</Content>
<Content Include="AxTable\MyTelemetryParameters">
<SubType>Content</SubType>
<Name>MyTelemetryParameters</Name>
<Link>MyTelemetryParameters</Link>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" />
<Import Project="$(BuildTasksDirectory)\Microsoft.Dynamics.Framework.Tools.BuildTasks.17.0.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<AxClass xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Name>DMFDefinitionGroupExecutionHistory_Extension</Name>
<SourceCode>
<Declaration><![CDATA[
/// <summary>
/// <c>DMFDefinitionGroupExecutionHistory_Extension</c> Table extension
/// </summary>
[ExtensionOf(tableStr(DMFDefinitionGroupExecutionHistory))]
final class DMFDefinitionGroupExecutionHistory_Extension
{
}
]]></Declaration>
<Methods>
<Method>
<Name>insertExecutionHistory</Name>
<Source><![CDATA[
/// <summary>
/// Insert execution history
/// </summary>
/// <param name = "_definitionGroupExecution"><c>DMFDefinitionGroupExecution</c> record</param>
public void insertExecutionHistory(DMFDefinitionGroupExecution _definitionGroupExecution)
{
next insertExecutionHistory(_definitionGroupExecution);

DMFDefinitionGroupExecution dmfDefinitionGroupExecution = DMFDefinitionGroupExecution::find(_definitionGroupExecution.DefinitionGroup,_definitionGroupExecution.Entity,_definitionGroupExecution.ExecutionId);
DMFDefinitionGroupExecutionHistory dmfDefinitionGroupExecutionHistory = DMFDefinitionGroupExecutionHistory::find(dmfDefinitionGroupExecution.DefinitionGroup, dmfDefinitionGroupExecution.Entity,
dmfDefinitionGroupExecution.ExecutionId, dmfDefinitionGroupExecution.WriteStartDateTime, true);

// Add any other conditions to log only for the entities you want here.
if (dmfDefinitionGroupExecutionHistory.RecId)
{
new TelemetryDataManagementImport(dmfDefinitionGroupExecutionHistory.WriteStartDateTime, dmfDefinitionGroupExecutionHistory.WriteEndDateTime, dmfDefinitionGroupExecutionHistory).processEvent(MyApplicationInsightsEventNames::DMFDefinitionGroupExecutionHistory);
}
}

]]></Source>
</Method>
</Methods>
</SourceCode>
</AxClass>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<AxClass xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Name>MyApplicationInsightsEventIds</Name>
<SourceCode>
<Declaration><![CDATA[
internal static final class MyApplicationInsightsEventIds
{
internal static const str WHSShipConfirm = '1'; // eventId to indicate WHS ship confirm. Add more explanation to indicate the eventId here.
}

]]></Declaration>
<Methods />
</SourceCode>
</AxClass>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<AxClass xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Name>MyApplicationInsightsEventNames</Name>
<SourceCode>
<Declaration><![CDATA[
internal final class MyApplicationInsightsEventNames
{
internal static const str WHSShipConfirm = 'My_CompanysShipConfirmCodeExecutedSuccessfully'; // eventName to indicate WHS ship confirm. Add more explanation to indicate the eventname here.
internal static const str DMFDefinitionGroupExecutionHistory= 'My_Companys_DMFExceutionHistory'; // eventName to indicate DMFExceutionHistory. Add more explanation to indicate the eventname here.
}
]]></Declaration>
<Methods />
</SourceCode>
</AxClass>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<AxClass xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Name>MyApplicationInsightsEventProperties</Name>
<SourceCode>
<Declaration><![CDATA[
/// <summary>
/// The <c>MyApplicationInsightsEventProperties</c> class contains all available event properties that can be used in the Application Insights telemetry.
/// </summary>
/// <remarks>
/// The names must be unique.
/// Please keep the list sorted alphabetically in ascending order.
/// </remarks>
internal static final class MyApplicationInsightsEventProperties
{
internal static const str InventLocationId = 'inventLocationId';
internal static const str LoadId = 'loadId';
internal static const str LoadStatus = 'loadStatus';
internal static const str NumOfLines = 'numOfLines';
internal static const str SalesId = 'salesId';
internal static const str CustAccount = 'custAccount';
internal static const str SalesStatus = 'salesStatus';
internal static const str DeliveryDate = 'deliveryDate';
internal static const str PurchId = 'PurchId';
internal static const str VendorName = 'vendorName';
internal static const str PurchStatus = 'PurchStatus';
internal static const str ElapsedMilliseconds = 'ElapsedMilliseconds';
internal static const str DefinitionGroup = 'DefinitionGroup';
internal static const str Entity = 'Entity';
internal static const str ExecutionId = 'ExecutionId';
internal static const str NoOfRecords = 'NoOfRecords';
internal static const str NumOfTargetNew = 'NumOfTargetNew';
internal static const str NumOfTargetUpdated = 'NumOfTargetUpdated';

}
]]></Declaration>
<Methods />
</SourceCode>
</AxClass>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<AxClass xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Name>MyApplicationInsightsProperty</Name>
<SourceCode>
<Declaration><![CDATA[
/// <summary>
/// Concrete class for Application Insights message payload properties.
/// </summary>
public final class MyApplicationInsightsProperty extends SysApplicationInsightsProperty
{
private str key;
private SysApplicationInsightsComplianceDataType dataType;

}
]]></Declaration>
<Methods>
<Method>
<Name>new</Name>
<Source><![CDATA[
// Constructor
public void new(str _key, str _value, SysApplicationInsightsComplianceDataType _dataType)
{
key = _key;
dataType = _dataType;
super(_value);
}

]]></Source>
</Method>
<Method>
<Name>initialize</Name>
<Source><![CDATA[
protected container initialize()
{
return [key, dataType];
}

]]></Source>
</Method>
</Methods>
</SourceCode>
</AxClass>
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<AxClass xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Name>MySysIntParametersFormEventHandler</Name>
<SourceCode>
<Declaration><![CDATA[
internal final class MySysIntParametersFormEventHandler
{
}
]]></Declaration>
<Methods>
<Method>
<Name>SysIntParameters_OnInitializing</Name>
<Source><![CDATA[
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
[FormEventHandler(formStr(SysIntParameters), FormEventType::Initializing)]
public static void SysIntParameters_OnInitializing(xFormRun sender, FormEventArgs e)
{

#define.ClassPath(@"\Classes\%1")

SysDictClass dictClass;
List extendedClassList;
ListEnumerator listEnumerator;
ClassName className;
// MethodName methodName;
ClassId childClass;
TreeNode childClassNode;
TreeNode methodNode;
int numberofMethods;
MyTelemetryParameters param;

//set parent class and method you want to investigate
className = classStr(MyTelemetryBase);
//methodName = "DefaultDimension";

dictClass = new SysDictClass(className2Id(classname));
extendedClassList = dictClass.extendedBy();

//loop through all child classes
if (extendedClassList.elements())
{
listEnumerator = extendedClassList.getEnumerator();

setprefix(strfmt("Class %1 extended by %2 classes.", className, int2str(extendedClassList.elements())));

while (listEnumerator.moveNext())
{
childClass = listEnumerator.current();
childClassNode = TreeNode::findNode(strFmt(#ClassPath, classId2Name(childClass)));

param = MyTelemetryParameters::find(childClassNode.AOTname());

if(!param)
{
ttsbegin;
param.clear();
param.TelemetryClass = childClassNode.AOTname();
param.IsEnabled = NoYes::Yes;
param.SeverityLevel = MyTelemetrySeverityLevel::Information;
param.insert();
ttscommit;
}

}

}

}

]]></Source>
</Method>
</Methods>
</SourceCode>
</AxClass>
Loading