Skip to content

[Event request] Codeunit 1018 "Purchase Doc. From Job" - procedure CreatePurchaseOrder #29678

@tkroes

Description

@tkroes

Why do you need this change?

I want to be able to act on the created purchase order by copying some data from the job to the purchase order in my extension. Currently the only events that exist in this process lie within the handling of the underlying requisition lines, but those don't provide an easy job-to-order link as far as I can see.

Describe the request

I would like to see an event after the check on the empty NoFilter that exposes this filter alongside the job parameter of the function, to allow finding the orders created from the job and allow copying data from the job to the relevant purchase headers.

            until TempDocumentEntry.Next() = 0;

        if NoFilter = '' then
            Error(NoPurchaseOrdersCreatedErr);

+       OnAfterBuildNoFilter(Job, NoFilter);

        PurchaseHeader.SetFilter("No.", NoFilter);
        PurchaseHeader.SetRange("Document Type", PurchaseHeader."Document Type"::Order);

        case PurchaseHeader.Count of

Internal work item: AB#621171

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an event

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions