Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Custom field from Warehouse Receipt Line (7317) to Posted Whse. Receipt Line (7319)

(1) ShareShare
ReportReport
Posted on by 55
Hi Guys,

Can you please assist, I have a custom field APTRRC_TempValQty on Warehouse Receipt Line table and want this value to be displayed in the same custom field in the Posted Whse. Receipt Line table after I post the warehouse receipt. I have already created the fields in both tables but do not know what EventSubscriber to use or if I am doing it correctly.

I have tried the following 3 EventSubscribers but my field value is not pulling through to the Posted Warehouse Receipt Lines:
 
   [EventSubscriber(ObjectType::Codeunit, Codeunit::"Whse.-Post Receipt", 'OnBeforePostedWhseRcptLineInsert', '', false, false)]
    local procedure OnBeforePostWhseReceiptLine(var PostedWhseReceiptLine: Record "Posted Whse. Receipt Line"; WarehouseReceiptLine: Record "Warehouse Receipt Line")
    begin
        PostedWhseReceiptLine.APTRRC_TempValQty := WarehouseReceiptLine.APTRRC_TempValQty;
    end;
 
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Whse.-Post Receipt", 'OnBeforePostWhseJnlLine', '', false, false)]
    local procedure OnBeforePostWhseJnlLine(var PostedWhseReceiptHeader: Record "Posted Whse. Receipt Header"; var PostedWhseReceiptLine: Record "Posted Whse. Receipt Line"; var WhseReceiptLine: Record "Warehouse Receipt Line"; var TempTrackingSpecification: Record "Tracking Specification" temporary; var IsHandled: Boolean)
    begin
        PostedWhseReceiptLine.APTRRC_TempValQty := WhseReceiptLine.APTRRC_TempValQty;
    end;
 
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Whse.-Post Receipt", 'OnAfterPostedWhseRcptLineInsert', '', false, false)]
    local procedure OnBeforePostedWhseRcptLineInsert(var PostedWhseReceiptLine: Record "Posted Whse. Receipt Line"; WarehouseReceiptLine: Record "Warehouse Receipt Line")
    begin
        PostedWhseReceiptLine.APTRRC_TempValQty := WarehouseReceiptLine.APTRRC_TempValQty;
    end;
 
What am i doing wrong?
 
Thanks
Divan
 
 
 
  • Divan Profile Picture
    55 on at
    Custom field from Warehouse Receipt Line (7317) to Posted Whse. Receipt Line (7319)
    So for some reason the Even Subscriber did not work to get the values in the Posted Whse. Receipt Line (7319). I ended up creating a new table
    to store the values I want with the OnAfterCheckWhseRcptLine, I assume this is because this page gets deleted and the value disappears
    somewhere in between. (This value is a FlowField).

    This worked for me:

        [EventSubscriber(ObjectType::Codeunit, Codeunit::"Whse.-Post Receipt", 'OnAfterCheckWhseRcptLine', '', false, false)]
        local procedure OnAfterCheckWhseRcptLine(var WarehouseReceiptLine: Record "Warehouse Receipt Line")
        var
            WhseRcptValQty: Record APTRRC_WhseReceiptValQty;
        begin
            if WhseRcptValQty.Get(WarehouseReceiptLine."No.",WarehouseReceiptLine."Source No.", WarehouseReceiptLine."Line No.") then
        begin
                WhseRcptValQty.APTRRC_TempValQty := WarehouseReceiptLine.APTRRC_TempValQty;
                WhseRcptValQty.Modify();
            end else begin
                WhseRcptValQty.Init();
                WhseRcptValQty.APTRRC_No := WarehouseReceiptLine."No.";
                WhseRcptValQty.APTRRC_SourceNo := WarehouseReceiptLine."Source No.";
                WhseRcptValQty.APTRRC_LineNo := WarehouseReceiptLine."Line No.";
                WhseRcptValQty.APTRRC_TempValQty := WarehouseReceiptLine.APTRRC_TempValQty;
                WhseRcptValQty.Insert();
            end;
        end;

    And from this table I made a new flowfield to the Posted Whse Receipt table and the values is now visible.
  • DR-26060934-0 Profile Picture
    on at
    Custom field from Warehouse Receipt Line (7317) to Posted Whse. Receipt Line (7319)
    .
  • Divan Profile Picture
    55 on at
    Custom field from Warehouse Receipt Line (7317) to Posted Whse. Receipt Line (7319)
    Hi gdrenteria,

    I have a similar event than the one in the link you have provided but my data is still not pulling through to the posted warehouse receipt, the one I have used that is similar is
     
       [EventSubscriber(ObjectType::Codeunit, Codeunit::"Whse.-Post Receipt", 'OnBeforePostedWhseRcptLineInsert', '', false, false)]
        local procedure OnBeforePostWhseReceiptLine(var PostedWhseReceiptLine: Record "Posted Whse. Receipt Line"; WarehouseReceiptLine: Record "Warehouse Receipt Line")
        begin
            PostedWhseReceiptLine.APTRRC_TempValQty := WarehouseReceiptLine.APTRRC_TempValQty;
        end;
  • gdrenteria Profile Picture
    17,460 Most Valuable Professional on at
    Custom field from Warehouse Receipt Line (7317) to Posted Whse. Receipt Line (7319)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,033 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,854 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans