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 JsonObject

    The message to post.

  • Returns Boolean

    True 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 JsonArray

    The messages to post.

  • Returns Boolean

    True 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 DateTime

    The timestamp of the message.

  • Message Text[]

    The message to post.

  • Verbosity Verbosity

    The verbosity of the message.

  • Properties Dictionary[Text,Text]

    Additional properties to include in the message.

  • Returns JsonObject

    The 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 Boolean

    Specifies 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 Boolean

    Specifies 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 Guid

    The 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 Boolean

    Specifies whether to throw an error if the column does not exist.

  • Returns Guid

    The 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 Integer

    The 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 Boolean

    Specifies whether to throw an error if the column does not exist.

  • Returns Integer

    The 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 Decimal

    The 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 Boolean

    Specifies whether to throw an error if the column does not exist.

  • Returns Decimal

    The 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 DateTime

    The 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 Boolean

    Specifies whether to throw an error if the column does not exist.

  • Returns DateTime

    The 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 Date

    The 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 Boolean

    Specifies whether to throw an error if the column does not exist.

  • Returns Date

    The 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 Boolean

    The 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 Boolean

    Specifies whether to throw an error if the column does not exist.

  • Returns Boolean

    The 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 Time

    The 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 Boolean

    Specifies whether to throw an error if the column does not exist.

  • Returns Time

    The 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 JsonObject

    The 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 Boolean

    Specifies whether to throw an error if the column does not exist.

  • Returns JsonObject

    The value.


RowCount

procedure RowCount(): Integer

Returns the number of rows in the current result set.

Parameters / Return Value

  • Returns Integer

    The number of rows.


GetRow

procedure GetRow(NewRowIndex: Integer): Boolean

Loads the row with the given index as the current row.

Parameters / Return Value

  • NewRowIndex Integer

    The index of the row to load.

  • Returns Boolean

    True if the row was loaded successfully.


GetNextRow

procedure GetNextRow(): Boolean

Loads the next row as the current row.

Parameters / Return Value

  • Returns Boolean

    True 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 DateTime

    The start date and time.

  • ToDateTime DateTime

    The 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 Date

    The start date and time.

  • ToDate Date

    The 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 Boolean

    True 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 Recordref

    The 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 RecordRef

  • FoundFieldNo 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 RecordRef

  • FldRef FieldRef

  • TextValue 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 RecordRef

  • FldRef FieldRef

  • TextValue 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 RecordRef

  • FldRef FieldRef

  • TextValue Text[]

  • Handled Boolean



EOS Labs -