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

Announcements

No record found.

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 WH Shipment to posted sales shipment

(1) ShareShare
ReportReport
Posted on by 98
Howto transfer custom (pnumber) field from WH Shipment header to posted sales shipment/Sales Shipment Header  on posting Wh shipment. 
Fields are in both tables already.
 
Now I have but is is not copying field.
 
[EventSubscriber(ObjectType::Codeunit, Codeunit::/Whse.-Post Shipment/, 'OnInitSourceDocumentHeaderOnBeforeSalesHeaderModify', '', false, false)]
    local procedure CopyProNumberToSalesShipment(var SalesHeader: Record /Sales Header/; WarehouseShipmentHeader: Record /Warehouse Shipment Header/)
    var
        WarehouseShipmentHeaderExt: Record /Warehouse Shipment Header/ temporary;
        SalesShipmentHeaderExt: Record /Sales Shipment Header/ temporary;
    begin
        WarehouseShipmentHeaderExt.SetRange(/No./, WarehouseShipmentHeader./No./);
        if WarehouseShipmentHeaderExt.FindFirst() then begin
            SalesShipmentHeaderExt.SetRange(/No./, SalesHeader./No./);
            if SalesShipmentHeaderExt.FindFirst() then begin
                SalesShipmentHeaderExt./PNumber/ := WarehouseShipmentHeaderExt./PNumber/;
                SalesShipmentHeaderExt.Modify();
            end;
        end;
    end;
 
 
I have the same question (0)
  • Suggested answer
    Gerardo Rentería García Profile Picture
    25,977 Most Valuable Professional on at
    Hi
    I would think about this place. I hope it will help you.
    Best regards
    Gerardo
  • Suggested answer
    Ariba Mehdi Profile Picture
    166 on at
    Hi there,

    Verify if you have assigned the same field ID in both tables. If not, assign matching field IDs to both fields and check again. 
     
    Hope it helps!
     
  • Verified answer
    YUN ZHU Profile Picture
    99,611 Super User 2026 Season 1 on at
    Just add a simple test: https://yzhums.com/4118/#toc10
     
    Hope this helps as well.
    Thanks.
    ZHU
  • Hans Werps Profile Picture
    98 on at
    Thx working

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,060 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,086 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 700 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans