Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

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

Posted on by 53
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
    Divan 53 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.
  • Custom field from Warehouse Receipt Line (7317) to Posted Whse. Receipt Line (7319)
    .
  • Divan Profile Picture
    Divan 53 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
    gdrenteria 9,472 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans