Dynamics 365 Business Central: How to prohibit partial (split) shipment of orders

Dynamics 365 Business Central

Hi, Readers.
Today I would like to share another mini tip about Business Central, how to prohibit partial shipment of orders in Business Central.
As you might know, Business Central supports partial shipments. In a partial shipment, an order isn’t all shipped at once. For example, from an order for 100 units, you ship 40 units immediately and 60 units later.

There are no limits on the number of shipments that can be made for an order. But, can we prohibit this standard behavior? The order can be posted shipment only when Qty. to Ship is equal to Quantity. Because some customers only want to receive the items once.

Yes, in fact, before you can use partial shipments in Business Central, you must specify that the customer accepts partial shipments by setting the Shipping Advice field on the Customer Card page.

Shipping Advice
Specifies if the customer accepts partial shipment of orders.

Partial or Complete

You can also change the Shipping Advice field before posting on the Sales Order page.

If Shipping Advice is Complete, the following error will be prompted during posting.

This document cannot be shipped completely. Change the value in the Shipping Advice field to Partial.

PS: By default, Business Central sets the field in the Customer Card page as Partial, which allows partial shipments.

This is how you would control it, but there is a small problem here, the end user can modify this value, so if you want to make it perfect, you need to restrict the user from modifying it. Generally there are several ways:
PS: Business Central 2023 wave 2 (BC23): Customize field editability from UI (Lock editing & Unlock editing)

1. Customize pages for profiles

2. Use Designer
PS: Dynamics 365 Business Central SaaS: How to deploy your Design Extension (.zip file) to production environment

3. Customization
A Simple Example: Add a new field in User Setup, “Allow Modify Shipping Advice”. Only when this field is true, the user can modify the Shipping Advice on the Sales Order.

Test video:

Test code:

pageextension 50202 SalesOrderExt extends "Sales Order"
{
    layout
    {
        modify("Shipping Advice")
        {
            Editable = AllowModifyShippingAdvice;
        }
    }

    var
        AllowModifyShippingAdvice: Boolean;

    trigger OnOpenPage()
    var
        UserSetup: Record "User Setup";
    begin
        AllowModifyShippingAdvice := false;
        if UserSetup.Get(UserId) then
            if UserSetup."Allow Modify Shipping Advice" then
                AllowModifyShippingAdvice := true;
    end;
}


tableextension 50214 UserSetupExt extends "User Setup"
{
    fields
    {
        field(50100; "Allow Modify Shipping Advice"; Boolean)
        {
            Caption = 'Allow Modify Shipping Advice';
            DataClassification = CustomerContent;
        }
    }
}
pageextension 50214 UserSetupPageExt extends "User Setup"
{
    layout
    {
        addafter("Allow Posting To")
        {
            field("Allow Uninstallation"; Rec."Allow Modify Shipping Advice")
            {
                ApplicationArea = All;
            }
        }
    }
}

Okay, let’s discuss the last question. If the shipment needs to use Warehouse Shipment (Require Shipment), will it be restricted by this control? For example,

When you try to modify Qty. to Ship on Warehouse Shipment, you will first see the following confirmation message.

Shipping Advice is set to Complete. Qty. to Ship should be 100.

Accept the entered value?

If you select Yes, the modification will be successful.

But just like the Sales Order, an error will occur when you try to post the Warehouse Shipment. So the answer is yes.

This document cannot be shipped completely. Change the value in the Shipping Advice field to Partial.

That’all. Give it a try!!!😁

More details about Process partial shipments

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL