OnAfterCreatePurchaseRecord

<< Click to Display Table of Contents >>

Navigation:  Zetadocs SDK Guide > Zetadocs SDK API >

OnAfterCreatePurchaseRecord

OnAfterCreatePurchaseRecord Event

Runs just after the Purchase Record has been created. It provides methods to access the created Purchase Header and Zetadocs Review Header and Lines.

 

Publisher

    [IntegrationEvent(false, false)]

    procedure OnAfterCreatePurchaseRec(var onAfterCreatePurchaseRecHandler: Codeunit "Zdd OnAfterCreatePurchaseRec")

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

    local procedure OnAfterCreatePurchaseRec(var onAfterCreatePurchaseRecHandler: Codeunit "Zdd OnAfterCreatePurchaseRec")

    begin

    end;

 

Zdd OnAfterCreatePurchaseRec Codeunit

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

Method name

Description

GetPurchaseHeader(var purchHeader: Record "Purchase Header")

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

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

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

GetZdReviewLines(var reviewLines: Record "Zetadocs ADE Lines")

Returns the Zetadocs Review Lines that were shown on the preview page.

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.

GetCreatedPurchaseLines(var createdPurchaseLines: List of [RecordId])

Returns the list of recordIds for the created purchase lines.

GetReviewLine(purchaseLineId: RecordId; var reviewLine: Record "Zetadocs ADE Lines")

Returns the Zetadocs Review Line used to create the Purchase Line with the given RecordId.

 

GetPurchaseHeader Method

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

 

Syntax

onAfterCreatePurchaseHeaderHandler.GetPurchaseHeader(var purchHeader: Record "Purchase Header")

 

Parameters

purchHeader

Type: Record "Purchase Header"

The record variable for the current Purchase Header created.

 

GetZdReviewHeader Method

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

 

Syntax

onAfterCreatePurchaseHeaderHandler.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.

 

GetZdReviewLines Method

Will return the Zetadocs Review Lines that were shown on the preview page.

 

Syntax

onAfterCreatePurchaseHeaderHandler.GetZdReviewLines(var reviewLines: Record "Zetadocs ADE Lines")

 

Parameters

reviewLines

Type: Record "Zetadocs ADE lines"

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

 

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

onAfterCreatePurchaseHeaderHandler.GetZdIsPreview(var isPreview: Boolean)

 

Parameters

isPreview

Type: Boolean

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

 

GetCreatedPurchaseLines Method

Will return the list of recordIds for the created purchase lines.

 

Syntax

onAfterCreatePurchaseRecHandler.GetCreatedPurchaseLines(var createdPurchaseLines: List of [RecordId])

 

Parameters

createdPurchaseLines

Type: List of [RecordId]

The variable list containing the RecordIds of the Purchase Lines that were created as part of the process.

 

GetReviewLine Method

Will return the review line used to create the Purchase Line for a given Purchase Line RecordId.

 

Syntax

onAfterCreatePurchaseRecHandler.GetReviewLine(purchaseLineId: RecordId; var reviewLine: Record "Zetadocs ADE Lines")

 

Parameters

purchaseLineId

Type: RecordId

The RecordId of the Purchase Line to fetch the Zetadocs Review Line used to create it.

 
reviewLine

Type: Record "Zetadocs ADE Lines"

The variable that will return the Zetadocs Review Line.