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...
Suggested Answer

Can I run the OOB code unit for Create Pick from Warehouse Shipment document?

(0) ShareShare
ReportReport
Posted on by 25

Hi team, 

We are trying to create automatically the Pick from a Warehouse Shipment document when all items are available to be picked (to avoid "nothing to handle" error message in Warehouse people's operation). The only missing part is to run the native Create Pick Action that is available in Warehouse Shipment document, we are not sure how to add the Warehouse Shipment input to run the code unit. 

pastedimage1679086541262v1.png

Do you have any ideas on how to proceed? I appreciate the help. 

Thank you, 

  • Suggested answer
    Bilal Haider Profile Picture
    487 on at

    Hi,

    This is the procedure in standard that is creating Pick from Warehouse document. You can get inspiration from this. But make sure you have done proper validations to avoid inconsistencies.

        procedure CreatePickDoc(var WhseShptLine: Record "Warehouse Shipment Line"; WhseShptHeader2: Record "Warehouse Shipment Header")
        var
            IsHandled: Boolean;
        begin
            IsHandled := false;
            OnCreatePickDocOnBeforeCreatePickDoc(Rec, WhseShptLine, WhseShptHeader2, HideValidationDialog, IsHandled);
            if IsHandled then
                exit;
    
            WhseShptHeader2.TestField(Status, WhseShptHeader.Status::Released);
            WhseShptLine.SetFilter(Quantity, '>0');
            WhseShptLine.SetRange("Completely Picked", false);
            if WhseShptLine.Find('-') then
                CreatePickDocFromWhseShpt(WhseShptLine, WhseShptHeader2, HideValidationDialog)
            else
                if not HideValidationDialog then
                    Message(Text011);
        end;

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 Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 748 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 354 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 351 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans