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

Notifications

Announcements

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 105
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
    25,396 Most Valuable Professional on at
  • Divan Profile Picture
    105 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
    105 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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,651

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 808 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 718 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans