Codeunit 18122337 EOS004 AppInsights Client
Codeunit 18122337 EOS004 AppInsights Client
Provides access to Application Insights data. This client supports executing queries and also emitting events.
Methods
GetConfigurationKeys
procedure GetConfigurationKeys(): List of [Text[250]]
Parameters / Return Value
- Returns
List[Text]
GetSecretConfigurationKeys
procedure GetSecretConfigurationKeys(): List of [Text[250]]
Parameters / Return Value
- Returns
List[Text]
InitializeForPost
procedure InitializeForPost(ConnectionString: Text)
Enables log posting to Application Insights.using the given connection string.
Parameters / Return Value
ConnectionString
Text[]The connection string to use.
Initialize
procedure Initialize(ServiceConfig: Record "EOS004 Service Config.")
Initializes the client with the given service configuration.
Parameters / Return Value
ServiceConfig
Record "EOS004 Service Config."The service configuration.
PostMessage
procedure PostMessage(jo: JsonObject): Boolean
Post a message to Application Insights. Use ‘CreateMessage’ to create a message to be posted.
Parameters / Return Value
jo
JsonObjectThe message to post.
Returns
BooleanTrue if the message was posted successfully.
PostMessage
procedure PostMessage(ja: JsonArray): Boolean
Post multiple messages to Application Insights. Use ‘CreateMessage’ to create a message to be posted.
Parameters / Return Value
ja
JsonArrayThe messages to post.
Returns
BooleanTrue if the message was posted successfully.
CreateMessage
procedure CreateMessage(Timestamp: DateTime;Message: Text;Verbosity: Verbosity;Properties: Dictionary of [Text, Text]) result: JsonObject
Create a message to be posted to Application Insights.
Parameters / Return Value
Timestamp
DateTimeThe timestamp of the message.
Message
Text[]The message to post.
Verbosity
VerbosityThe verbosity of the message.
Properties
Dictionary[Text,Text]Additional properties to include in the message.
Returns
JsonObjectThe message as a JsonObject.
RunQuery
procedure RunQuery(QueryString: Text)
Executes the given query against Application Insights. This is a TryFunction.
Parameters / Return Value
QueryString
Text[]The query to execute.
ListTables
procedure ListTables(): List of [Text]
Returns the list of tables that the last executed query has returned.
Parameters / Return Value
Returns
List[Text]The tables in the current result set.
BeginTableRead
procedure BeginTableRead(TableName: Text): Boolean
Loads the given table as the current table.
Parameters / Return Value
TableName
Text[]The name of the table to load.
Returns
BooleanSpecifies whether the load was successful.
GetFields
procedure GetFields(var TempField: Record "Name/Value Buffer")
Returns the list of columns that the current table has.
Parameters / Return Value
TempField
Record "Name/Value Buffer"The list of columns.
GetValueAsText
procedure GetValueAsText(ColumnName: Text): Text
Returns the value of the given column as Text.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
Returns
Text[]The value.
GetValueAsText
procedure GetValueAsText(ColumnName: Text; WithError: Boolean): Text
Returns the value of the given column as Text.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
WithError
BooleanSpecifies whether to throw an error if the column does not exist.
Returns
Text[]The value.
IsValueGuid
procedure IsValueGuid(ColumnName: Text)
Checks if a column value is a valid GUID.
Parameters / Return Value
ColumnName
Text[]The name of the column to check.
GetValueAsGuid
procedure GetValueAsGuid(ColumnName: Text): Guid
Returns the value of the given column as Guid.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
Returns
GuidThe value.
GetValueAsGuid
procedure GetValueAsGuid(ColumnName: Text; WithError: Boolean): Guid
Returns the value of the given column as Guid.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
WithError
BooleanSpecifies whether to throw an error if the column does not exist.
Returns
GuidThe value.
IsValueInt
procedure IsValueInt(ColumnName: Text)
Checks if a column value is a valid Integer.
Parameters / Return Value
ColumnName
Text[]The name of the column to check.
GetValueAsInt
procedure GetValueAsInt(ColumnName: Text): Integer
Returns the value of the given column as Integer.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
Returns
IntegerThe value.
GetValueAsInt
procedure GetValueAsInt(ColumnName: Text; WithError: Boolean): Integer
Returns the value of the given column as Integer.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
WithError
BooleanSpecifies whether to throw an error if the column does not exist.
Returns
IntegerThe value.
IsValueDecimal
procedure IsValueDecimal(ColumnName: Text)
Checks if a column value is a valid Decimal.
Parameters / Return Value
ColumnName
Text[]The name of the column to check.
GetValueAsDecimal
procedure GetValueAsDecimal(ColumnName: Text): Decimal
Returns the value of the given column as Decimal.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
Returns
DecimalThe value.
GetValueAsDecimal
procedure GetValueAsDecimal(ColumnName: Text; WithError: Boolean): Decimal
Returns the value of the given column as Decimal.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
WithError
BooleanSpecifies whether to throw an error if the column does not exist.
Returns
DecimalThe value.
IsValueDateTime
procedure IsValueDateTime(ColumnName: Text)
Checks if a column value is a valid DateTime.
Parameters / Return Value
ColumnName
Text[]The name of the column to check.
GetValueAsDateTime
procedure GetValueAsDateTime(ColumnName: Text): DateTime
Returns the value of the given column as DateTime.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
Returns
DateTimeThe value.
GetValueAsDateTime
procedure GetValueAsDateTime(ColumnName: Text; WithError: Boolean): DateTime
Returns the value of the given column as DateTime.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
WithError
BooleanSpecifies whether to throw an error if the column does not exist.
Returns
DateTimeThe value.
IsValueDateOnly
procedure IsValueDateOnly(ColumnName: Text)
Checks if a column value is a valid Date.
Parameters / Return Value
ColumnName
Text[]The name of the column to check.
GetValueAsDateOnly
procedure GetValueAsDateOnly(ColumnName: Text): Date
Returns the value of the given column as Date.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
Returns
DateThe value.
GetValueAsDateOnly
procedure GetValueAsDateOnly(ColumnName: Text; WithError: Boolean): Date
Returns the value of the given column as Date.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
WithError
BooleanSpecifies whether to throw an error if the column does not exist.
Returns
DateThe value.
IsValueBool
procedure IsValueBool(ColumnName: Text)
Checks if a column value is a valid Boolean.
Parameters / Return Value
ColumnName
Text[]The name of the column to check.
GetValueAsBool
procedure GetValueAsBool(ColumnName: Text): Boolean
Returns the value of the given column as Boolean.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
Returns
BooleanThe value.
GetValueAsBool
procedure GetValueAsBool(ColumnName: Text; WithError: Boolean): Boolean
Returns the value of the given column as Boolean.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
WithError
BooleanSpecifies whether to throw an error if the column does not exist.
Returns
BooleanThe value.
IsValueTime
procedure IsValueTime(ColumnName: Text)
Checks if a column value is a valid Time.
Parameters / Return Value
ColumnName
Text[]The name of the column to check.
GetValueAsTime
procedure GetValueAsTime(ColumnName: Text): Time
Returns the value of the given column as Time.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
Returns
TimeThe value.
GetValueAsTime
procedure GetValueAsTime(ColumnName: Text; WithError: Boolean): Time
Returns the value of the given column as Time.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
WithError
BooleanSpecifies whether to throw an error if the column does not exist.
Returns
TimeThe value.
GetValueAsObject
procedure GetValueAsObject(ColumnName: Text): JsonObject
Returns the value of the given column as JsonObject.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
Returns
JsonObjectThe value.
GetValueAsObject
procedure GetValueAsObject(ColumnName: Text; WithError: Boolean): JsonObject
Returns the value of the given column as JsonObject.
Parameters / Return Value
ColumnName
Text[]The name of the column to get.
WithError
BooleanSpecifies whether to throw an error if the column does not exist.
Returns
JsonObjectThe value.
RowCount
procedure RowCount(): Integer
Returns the number of rows in the current result set.
Parameters / Return Value
Returns
IntegerThe number of rows.
GetRow
procedure GetRow(NewRowIndex: Integer): Boolean
Loads the row with the given index as the current row.
Parameters / Return Value
NewRowIndex
IntegerThe index of the row to load.
Returns
BooleanTrue if the row was loaded successfully.
GetNextRow
procedure GetNextRow(): Boolean
Loads the next row as the current row.
Parameters / Return Value
Returns
BooleanTrue if the row was loaded successfully.
FormatDateQuery
procedure FormatDateQuery(FromDateTime: DateTime; ToDateTime: DateTime): Text
Formats a date query for the given date range.
Parameters / Return Value
FromDateTime
DateTimeThe start date and time.
ToDateTime
DateTimeThe end date and time.
Returns
Text[]The formatted date query.
FormatDateQuery
procedure FormatDateQuery(FromDate: Date; ToDate: Date): Text
Formats a date query for the given date range (from 00:00 to 23:59).
Parameters / Return Value
FromDate
DateThe start date and time.
ToDate
DateThe end date and time.
Returns
Text[]The formatted date query.
ReaderDialogIsOpen
procedure ReaderDialogIsOpen(): Boolean
Returns true if the reader dialog is open.
Parameters / Return Value
Returns
BooleanTrue if the reader dialog is open, false otherwise.
DeserializeToRecordRef
procedure DeserializeToRecordRef(var RecRef: Recordref)
Deserializes the current row to the given RecordRef by trying to find a field with the same name for each column.
Obsolete fields are excluded.
BLOB fields will be found, but by default no deserialization will happen. You must subscribe to OnDeserializeToRecordRefSetBlobValue and handled BLOB fields explicitly.
There are DeserializeToRecordRef[xxx] events available to customize deserialization.
Parameters / Return Value
RecRef
RecordrefThe target RecordRef where field values will be written to.
OpenReaderDialog
procedure OpenReaderDialog()
Opens a read status dialog.
StepReaderDialog
procedure StepReaderDialog()
Steps the read status dialog. This is called automatically when the dialog is open.
CloseReaderDialog
procedure CloseReaderDialog()
Closes the read status dialog.
Events
OnDeserializeToRecordRefBeforeFindFieldNo
local procedure OnDeserializeToRecordRefBeforeFindFieldNo(ColumnName: Text[250]; var RecRef: RecordRef; var FoundFieldNo: Integer)
Parameters / Return Value
ColumnName
Text[250]RecRef
RecordRefFoundFieldNo
Integer
OnDeserializeToRecordRefBeforeSetFieldValue
local procedure OnDeserializeToRecordRefBeforeSetFieldValue(ColumnName: Text[250]; var RecRef: RecordRef; var FldRef: FieldRef; TextValue: Text; var Handled: Boolean)
Parameters / Return Value
ColumnName
Text[250]RecRef
RecordRefFldRef
FieldRefTextValue
Text[]Handled
Boolean
OnDeserializeToRecordRefAfterSetFieldValue
local procedure OnDeserializeToRecordRefAfterSetFieldValue(ColumnName: Text[250]; var RecRef: RecordRef; var FldRef: FieldRef; TextValue: Text)
Parameters / Return Value
ColumnName
Text[250]RecRef
RecordRefFldRef
FieldRefTextValue
Text[]
OnDeserializeToRecordRefSetBlobValue
local procedure OnDeserializeToRecordRefSetBlobValue(ColumnName: Text[250]; var RecRef: RecordRef; var FldRef: FieldRef; TextValue: Text; var Handled: Boolean)
Parameters / Return Value
ColumnName
Text[250]RecRef
RecordRefFldRef
FieldRefTextValue
Text[]Handled
Boolean
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.