Skip to content

[Bug]: Missing Blocked Check for the Bill-to Customer in Job #9559

Description

@pri-kise

Describe the issue

In the job table the Sell-to Customer No. is checked when it's validated wether the customer is blocked, but the bill-to customer no. isn't checked for the Blocked value of the customer.

This is issue is a follow up to issue: https://github.com/microsoft/BusinessCentralApps/issues/1837

Expected behavior

I would suggest to bring back a Blocked check in the Bill-To customer no. field and align with the check on sales orders.

Steps to reproduce

  • Create a job
  • Create a not blocked customer for Sell-to
  • Create a blocked customer for Bill-to
  • Validate the Sell-to
  • // [WHEN] The Bill-to is validated
  • // [THEN] We would expect an error when a blocked customer is validated as bill-to

Additional context

I guess that this issue was created when the Job table was improved by having a sell-to cutomer no addtional to the bill-to customer no.

When you check the source for BC19 then you will see that there was a check for the bill-to customer no.
https://github.com/StefanMaron/MSDyn365BC.Code.History/blob/w1-19/BaseApp/Source/Base%20Application/Job.Table.al

            if Cust.Blocked = Cust.Blocked::All then
                Error(
                  BlockedCustErr,
                  FieldCaption("Bill-to Customer No."),
                  "Bill-to Customer No.",
                  Cust.TableCaption,
                  FieldCaption(Blocked),
                  Cust.Blocked);

This is the code in the Job Table in current BC:

        if Job."Sell-to Customer No." <> '' then begin
            SellToCustomer.Get(Job."Sell-to Customer No.");
            IsHandled := false;
            OnValidateSellToCustomerNoOnBeforeCheckBlockedCustOnDocs(Rec, SellToCustomer, IsHandled);
            if not IsHandled then
                SellToCustomer.CheckBlockedCustOnDocs(SellToCustomer, Enum::"Sales Document Type"::Order, false, false);
        end;

I will provide a fix for a bug

  • I will provide a fix for a bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ownership: ManualPreserve the manually selected team ownershipSCMGitHub request for SCM area

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions