OnAfterCreatePurchaseLine

<< Click to Display Table of Contents >>

Navigation:  Zetadocs SDK Guide > Zetadocs SDK API >

OnAfterCreatePurchaseLine

OnAfterCreatePurchaseLine Event

Runs just after the Purchase Line is created. It provides methods to access and update the Purchase Line and access the Zetadocs Review Header and Lines.

 

Publisher

    [IntegrationEvent(false, false)]

    procedure OnAfterCreatePurchaseLine(var onAfterCreatePurchaseLineHandler: Codeunit "Zdd OnAfterCreatePurchaseLine")

    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", 'OnAfterCreatePurchaseLine', '', true, true)]

    local procedure OnAfterCreatePurchaseLine(var onAfterCreatePurchaseLineHandler: Codeunit "Zdd OnAfterCreatePurchaseLine")

    begin

    end;

 

Zdd OnAfterCreatePurchaseLine Codeunit

This codeunit exposes procedures that give you access to the Purchase Line, Zetadocs Review Header and Zetadocs Review Lines.

Method name

Description

GetPurchaseLine(var purchLine: Record "Purchase Line")

Returns the Purchase Line, just after it has been been created.

GetZdReviewHeader(var reviewHeader: Record "Zetadocs ADE Review Header")

Returns the Zetadocs Review Header that was shown on the preview page.

GetZdReviewLine(var reviewLine: Record "Zetadocs ADE Lines")

Returns the Zetadocs  Review Line that will be used to create the Purchase Line.

GetZdIsPreview(var isPreview: Boolean)

Returns if the Purchase Record created is a preview used to check/validate before creating the real Purchase Record. The preview record will be deleted after we've completed the checks.

SetPurchaseLine(var purchLine: Record "Purchase Line")

Overrides the Purchase Line with the data provided.

GetCustomFieldsForReviewHeader(var customFields: JsonArray)

Returns the JsonArray of custom fields from the custom layout for the ReviewHeader.

GetCustomFieldsForReviewLine(var lineCustomFields: JsonArray)

Returns the JsonArray of custom fields from the custom layout for the Zetadocs Review Line.

 

GetPurchaseLine Method

Will return the Purchase Line, just after it has been created.

 

Syntax

onAfterCreatePurchaseLineHandler.GetPurchaseLine(var purchHeader: Record "Purchase Line")

 

Parameters

purchLine

Type: Record "Purchase Line"

The record variable for the current Purchase Line being created.

 

GetZdReviewHeader Method

Will return the Zetadocs Review Header that was shown on the preview page.

 

Syntax

onAfterCreatePurchaseLineHandler.GetZdReviewHeader(var reviewHeader: Record "Zetadocs ADE Review Header")

 

Parameters

reviewHeader

Type: Record "Zetadocs ADE Review Header"

The temporary record variable containing the current information of the Zetadocs Review Header shown on the preview page.

 

GetZdReviewLine Method

Will return the Zetadocs Review Line that was shown on the preview page.

 

Syntax

onAfterCreatePurchaseLineHandler.GetZdReviewLine(var reviewLine: Record "Zetadocs ADE Lines")

 

Parameters

reviewLine

Type: Record "Zetadocs ADE lines"

The temporary record variable containing the current information of the  Zetadocs Review Lines shown on the preview page that will be used to create the Purchase Line.

 

GetZdIsPreview Method

Will return if the Purchase Record created is a preview used to check/validate before creating the real Purchase Record. The preview record will be deleted after we've completed the checks.

 

Syntax

onAfterCreatePurchaseLineHandler.GetZdIsPreview(var isPreview: Boolean)

 

Parameters

isPreview

Type: Boolean

The variable that will return if the Purchase Record being created is a preview used to check/validate before creating the real Purchase Record.

 

SetPurchaseLine Method

Will overrides the Purchase Line being created with the data provided.

 

Syntax

onAfterCreatePurchaseLineHandler.SetPurchaseLine(var purchLine: Record "Purchase Line")

 

Parameters

purchLine

Type: Record "Purchase Line"

The variable record variable that will update the current information of the Purchase Line.

 

GetCustomFieldsForReviewHeader Method

Will return  the JsonArray of custom fields from the custom layout for the Zetadocs Review Header.

 

Syntax

onAfterCreatePurchaseLineHandler.GetCustomFieldsForReviewHeader(var customFields: JsonArray)

 

Parameters

customFields

Type: Fields

The variable that will return the JsonArray of custom fields for the Zetadocs Review Header.

This will be an array of key/value objects, for example:
[{ "Key": "Vat No", "Value": "GB12345678" }, {"Key": "BankAccount", "Value": "123456" } ]

 

GetCustomFieldsForReviewLine Method

Will return the JsonArray of custom fields from the custom layout for the Zetadocs Review Line.

 

Syntax

onAfterCreatePurchaseLineHandler.GetCustomFieldsForReviewLine(var lineCustomFields: JsonArray))

 

Parameters

customFields

Type: Fields

The variable that will return the JsonArray of custom fields for the Review Header.

This will be an array of key/value objects, for example:
[{ "Key": "Vat No", "Value": "GB12345678" }, {"Key": "BankAccount", "Value": "123456" } ]