Codeunit 18122345 EOS Library EXT

Codeunit 18122345 EOS Library EXT

Contains a number of generic utility functions

Methods

Sign

procedure Sign(value: Decimal): Integer

Returns the sign of a number.

Parameters / Return Value

  • value Decimal

    A decimal value whose sign should be returned.

  • Returns Integer

    1 if positive, -1 if negative, 0 if 0.


SendMessage

procedure SendMessage(Address: Text; Request: JsonObject; var Response: JsonObject): Boolean

Parameters / Return Value

  • Address Text

  • Request JsonObject

  • Response JsonObject

  • Returns Boolean


TryTransferFields

procedure TryTransferFields(var SourceRecRef: RecordRef; var TargetRecRef: RecordRef)

Parameters / Return Value

  • SourceRecRef RecordRef

  • TargetRecRef RecordRef


NewLine

procedure NewLine(): Text[2]

Returns a string representing Environment.NewLine from C#.

Parameters / Return Value

  • Returns Text[2]

    A string of 2 characters representing [CR][LF].


GetParentCategoryCodes

procedure GetParentCategoryCodes(CategoryCode: Code[20]; var ValueBuffer: Record "Name/Value Buffer" temporary)

Get all the parent category code from the given ones

Parameters / Return Value

  • CategoryCode Code[20]

    the code from which find the parents

  • ValueBuffer Record "Name/Value Buffer"

    A Name Value Buffer with the found parents


IsParent

procedure IsParent(ParentCode: Code[20]; Child: Code[20]): Boolean

search in table Item Category if the given parameter “Parent Code” is really the parent of the given “Child Code”

Parameters / Return Value

  • ParentCode Code[20]

    The code to check if it is really the parent of the 2nd parameter

  • Child Code[20]

    The supposed child code

  • Returns Boolean

    true if the 1st parameter is the parent of the 2nd, otherwise false


GetChildCategoryCode

procedure GetChildCategoryCode(CategoryCode: Code[20]; var NameValue: Record "Name/Value Buffer" temporary)

Get all the child category code from the given ones

Parameters / Return Value

  • CategoryCode Code[20]

    the code from which find the childs

  • NameValue Record "Name/Value Buffer"

    A Name Value Buffer with the found childs


GetItemCategoryParentsFilter

procedure GetItemCategoryParentsFilter(ItemCategoryCode: Code[20]; WithEmpty: Boolean): Text

Generates a filter for a given item category code and all its parents.

Parameters / Return Value

  • ItemCategoryCode Code[20]

    The item category code.

  • WithEmpty Boolean

    Specifies whether an empty string should be included in the result filter.

  • Returns Text

    The generated filter string.


FromValueBufferToFilter

procedure FromValueBufferToFilter(var ValueBuffer: Record "Name/Value Buffer"): Text

Transform a Name Value buffer to an OR based filter

Parameters / Return Value

  • ValueBuffer Record "Name/Value Buffer"

    the list

  • Returns Text

    the OR based Filter


IsInValueBuffer

procedure IsInValueBuffer(var ValueBuffer: Record "Name/Value Buffer" temporary; findWhat: Code[20]): Boolean

check if some value is in the given Name/Value Buffer

Parameters / Return Value

  • ValueBuffer Record "Name/Value Buffer"

    Record “Name/Value Buffer”

  • findWhat Code[20]

    the code to find

  • Returns Boolean

    true if it was found, otherwise false


EnqueueCodeunit

procedure EnqueueCodeunit(CodeunitId: Integer; UseTaskScheduler: Boolean)

Parameters / Return Value

  • CodeunitId Integer

  • UseTaskScheduler Boolean


JoinText

procedure JoinText(Items: List of [Text]; Delimiter: Text): Text

Parameters / Return Value

  • Items List[Text]

  • Delimiter Text

  • Returns Text


JoinText

procedure JoinText(Items: List of [Text]; Delimiter: Text; FromIndex: Integer; ToIndex: Integer): Text

Parameters / Return Value

  • Items List[Text]

  • Delimiter Text

  • FromIndex Integer

  • ToIndex Integer

  • Returns Text


GetRfc1123DateTime

procedure GetRfc1123DateTime(MyDateTime: DateTime): Text

Parameters / Return Value

  • MyDateTime DateTime

  • Returns Text


ScrambleString

procedure ScrambleString(Value: Text; MinScrambleLength: Integer; PercentageToScramble: Integer): Text

Parameters / Return Value

  • Value Text

  • MinScrambleLength Integer

  • PercentageToScramble Integer

  • Returns Text


GetLocalization

procedure GetLocalization(): Code[10]

Returns localization of the current database/environment.

Parameters / Return Value

  • Returns Code[10]

    The two-letter code of the localization (IT, GB, DE, NZ, W1).


TestLocalization

procedure TestLocalization(ExpectedLocalization: Code[10])

Tests if the current database/environment localization matches the provided one. This is a TryFunction.

Parameters / Return Value

  • ExpectedLocalization Code[10]

    The two-letter code of the current localization.


TestLocalizationNot

procedure TestLocalizationNot(NonExpectedLocalization: Code[10])

Tests if the current database/environment localization does not match the provided one. This is a TryFunction.

Parameters / Return Value

  • NonExpectedLocalization Code[10]

    The two-letter code of the current localization.


Events

OnMessageReceived

local procedure OnMessageReceived(Address: Text; Request: JsonObject; var Response: JsonObject; var Handled: Boolean)

Parameters / Return Value

  • Address Text

  • Request JsonObject

  • Response JsonObject

  • Handled Boolean



EOS Labs -