web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
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 107
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
 
 
 
I have the same question (0)
  • Gerardo Rentería García Profile Picture
    27,310 Most Valuable Professional on at
  • Divan Profile Picture
    107 on at
    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;
  • DR-26060934-0 Profile Picture
    on at
    .
  • Divan Profile Picture
    107 on at
    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.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,496 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 961 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 870 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans