OnEnumConversion

<< Click to Display Table of Contents >>

Navigation:  Zetadocs SDK Guide > Zetadocs SDK API >

OnEnumConversion

OnEnumConversion Event

Runs prior to creation of the new Business Central invoice, to configure the mapping between Zetadocs enums and Business Central enums.

 

Publisher

    [IntegrationEvent(false, false)]

    procedure OnEnumConversion(var OnEnumConversionHandler: Codeunit "Zdd OnEnumConversion")

    begin

    end;

 

Subscriber

To subscribe to this event, you will need to decorate the subscriber method with the correct EventSubscriber attributes:

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Zetadocs Customize", 'OnEnumConversion', '', true, true)]

    local procedure OnEnumConversion(var OnEnumConversionHandler: Codeunit "Zdd OnEnumConversion")

    begin

    end;

 

Zdd OnEnumConversion codeunit

This codeunit exposes procedures that give you access to the Zetadocs Review Line, which is shown for user validation on the Zetadocs Review Screen.

Method name

Description

AddOrUpdatePurchaseLineMapping(mappingKey: enum "Zetadocs Review Line Type"; mappingValue: enum "Purchase Line Type")

Will return the context information about lookup being performed.

GetReviewLineTypeMapping(Dictionary of [enum "Zetadocs Review Line Type", enum "Purchase Line Type"]):

Will return the currently selected value for the lookup.

SetError(Text)

Will raise raise a validation error to the user.

 

AddOrUpdatePurchaseLineMapping Method

Will define a two way conversion between the provided enums.

 

Syntax

onLookupReviewLineHandler.GetLookupContextOnEnumConversionHandler(

             mappingKey: enum "Zetadocs Review Line Type";

 mappingValue: enum "Purchase Line Type")

 

Parameters

mappingKey

Type: enum "Zetadocs Review Line Type"

The enum value to be converted to a Purchase Line Type.

 

mappingValue

Type:  mappingValue: enum "Purchase Line Type"

The enum resulting from a conversion from the associated Zetadocs Review Line Type.

 

GetReviewLineTypeMapping Method

Will return the currently selected Value for the lookup.

 

Syntax

onLookupReviewLineHandler.GetLookupValue(var mappingDictionary: Dictionary of [enum "Zetadocs Review Line Type", enum "Purchase Line Type"])

 

Parameters

mappingDictionary

Type: Dictionary of [enum "Zetadocs Review Line Type", enum "Purchase Line Type"]

Will return the dictionary representing the current mapping.

 

SetError Method

Will raise an error including the provided text.

 

Syntax

onAddDefaultsToReviewLineHandler.SetError(errorText: Text")

 

Parameters

errorText

Type: Text

The message to be displayed to the user when the validation fails.