[IntegrationEvent(false, false)] local procedure OnBeforeBufferICInboxPurchaseHeaderInsert(var BufferICInboxPurchaseHeader: Record "Buffer IC Inbox Purch Header"; TempICPartnerICInboxPurchaseHeader: Record "IC Inbox Purchase Header" temporary; ICPartner: Record "IC Partner"; RegisteredPartner: Record "IC Partner" temporary) begin end;
[IntegrationEvent(false, false)] local procedure OnBeforeBufferICInboxSalesHeaderInsert(var BufferICInboxSalesHeader: Record "Buffer IC Inbox Sales Header"; TempICPartnerICInboxSalesHeader: Record "IC Inbox Sales Header" temporary; ICPartner: Record "IC Partner"; RegisteredPartner: Record "IC Partner" temporary) begin end;
The procedures would look like:
procedure PostICPurchaseHeaderToICPartnerInbox(ICPartner: Record "IC Partner"; var TempICPartnerICInboxPurchaseHeader: Record "IC Inbox Purchase Header" temporary; var RegisteredPartner: Record "IC Partner" temporary) var BufferICInboxPurchaseHeader: Record "Buffer IC Inbox Purch Header"; begin if not TempICPartnerICInboxPurchaseHeader.IsEmpty() then begin TempICPartnerICInboxPurchaseHeader.FindSet(); repeat BufferICInboxPurchaseHeader.TransferFields(TempICPartnerICInboxPurchaseHeader); BufferICInboxPurchaseHeader."Buy-from Vendor No." := RegisteredPartner."Vendor No."; BufferICInboxPurchaseHeader."Pay-to Vendor No." := RegisteredPartner."Vendor No."; OnBeforeBufferICInboxPurchaseHeaderInsert(BufferICInboxPurchaseHeader, TempICPartnerICInboxPurchaseHeader, ICPartner, RegisteredPartner); BufferICInboxPurchaseHeader.Insert(); until TempICPartnerICInboxPurchaseHeader.Next() = 0; end; end;
procedure PostICSalesHeaderToICPartnerInbox(ICPartner: Record "IC Partner"; var TempICPartnerICInboxSalesHeader: Record "IC Inbox Sales Header" temporary; var RegisteredPartner: Record "IC Partner" temporary) var BufferICInboxSalesHeader: Record "Buffer IC Inbox Sales Header"; begin if not TempICPartnerICInboxSalesHeader.IsEmpty() then begin TempICPartnerICInboxSalesHeader.FindSet(); repeat BufferICInboxSalesHeader.TransferFields(TempICPartnerICInboxSalesHeader); BufferICInboxSalesHeader."Sell-to Customer No." := RegisteredPartner."Customer No."; BufferICInboxSalesHeader."Bill-to Customer No." := RegisteredPartner."Customer No."; OnBeforeBufferICInboxSalesHeaderInsert(BufferICInboxSalesHeader, TempICPartnerICInboxSalesHeader, ICPartner, RegisteredPartner); BufferICInboxSalesHeader.Insert(); until TempICPartnerICInboxSalesHeader.Next() = 0; end; end;
Additional context
We would like to have the ability to overwrite Customer and Vendor number only in certain scenarios. Sometimes we need to keep the keep the original number from TempICPartnerICInbox record
Internal work item: AB#542668
Describe the request
Can you please add 2 new events:
In Procedures:
Event publishers would be:
[IntegrationEvent(false, false)] local procedure OnBeforeBufferICInboxPurchaseHeaderInsert(var BufferICInboxPurchaseHeader: Record "Buffer IC Inbox Purch Header"; TempICPartnerICInboxPurchaseHeader: Record "IC Inbox Purchase Header" temporary; ICPartner: Record "IC Partner"; RegisteredPartner: Record "IC Partner" temporary) begin end;
[IntegrationEvent(false, false)] local procedure OnBeforeBufferICInboxSalesHeaderInsert(var BufferICInboxSalesHeader: Record "Buffer IC Inbox Sales Header"; TempICPartnerICInboxSalesHeader: Record "IC Inbox Sales Header" temporary; ICPartner: Record "IC Partner"; RegisteredPartner: Record "IC Partner" temporary) begin end;
The procedures would look like:
procedure PostICPurchaseHeaderToICPartnerInbox(ICPartner: Record "IC Partner"; var TempICPartnerICInboxPurchaseHeader: Record "IC Inbox Purchase Header" temporary; var RegisteredPartner: Record "IC Partner" temporary) var BufferICInboxPurchaseHeader: Record "Buffer IC Inbox Purch Header"; begin if not TempICPartnerICInboxPurchaseHeader.IsEmpty() then begin TempICPartnerICInboxPurchaseHeader.FindSet(); repeat BufferICInboxPurchaseHeader.TransferFields(TempICPartnerICInboxPurchaseHeader); BufferICInboxPurchaseHeader."Buy-from Vendor No." := RegisteredPartner."Vendor No."; BufferICInboxPurchaseHeader."Pay-to Vendor No." := RegisteredPartner."Vendor No."; OnBeforeBufferICInboxPurchaseHeaderInsert(BufferICInboxPurchaseHeader, TempICPartnerICInboxPurchaseHeader, ICPartner, RegisteredPartner); BufferICInboxPurchaseHeader.Insert(); until TempICPartnerICInboxPurchaseHeader.Next() = 0; end; end;
procedure PostICSalesHeaderToICPartnerInbox(ICPartner: Record "IC Partner"; var TempICPartnerICInboxSalesHeader: Record "IC Inbox Sales Header" temporary; var RegisteredPartner: Record "IC Partner" temporary) var BufferICInboxSalesHeader: Record "Buffer IC Inbox Sales Header"; begin if not TempICPartnerICInboxSalesHeader.IsEmpty() then begin TempICPartnerICInboxSalesHeader.FindSet(); repeat BufferICInboxSalesHeader.TransferFields(TempICPartnerICInboxSalesHeader); BufferICInboxSalesHeader."Sell-to Customer No." := RegisteredPartner."Customer No."; BufferICInboxSalesHeader."Bill-to Customer No." := RegisteredPartner."Customer No."; OnBeforeBufferICInboxSalesHeaderInsert(BufferICInboxSalesHeader, TempICPartnerICInboxSalesHeader, ICPartner, RegisteredPartner); BufferICInboxSalesHeader.Insert(); until TempICPartnerICInboxSalesHeader.Next() = 0; end; end;
Additional context
We would like to have the ability to overwrite Customer and Vendor number only in certain scenarios. Sometimes we need to keep the keep the original number from TempICPartnerICInbox record Internal work item: AB#542668