microsoft / microsoft/BCApps

[Bug]: Double Production Orders from Planning Worksheet when Reservation is Missing

Open
#8,846 4 comments 0 reactions 1 assignee View on GitHub

@PredragMaricic is already working on this.

Since Aug 24, 2026.

Approved Team: SCM
Dominant language
AL
Stars
683
Forks
459
Avg merge
3d 26m
Merged PRs (30d)
633

Description

Describe the issue

When using Reordering Policy = Order there will be double demands if the reservation between the released production order and the sales order is cancelled.
When calculating regenerative plan there will be a line for creating a new production order, but not cancelling the old production order.

Expected behavior

The sum of the generated requsition lines should be 0.
Either there should be no lines, or there should be one to create a new production order and one to cancel the old production order.

Steps to reproduce
  1. Create/find an item with Replenishment System = Prod. Order and Reordering Policy = Order.
  2. Create a sales order containing that item.
  3. Use planning worksheet to calculate regenerative plan with filter for that item.
  4. Carry out action message to create a new planned production order.
  5. Release the created production order.
  6. On the production order line navigate to reservation entries and cancel reservation from current line.
  7. Do step 3 again (calculate regerative plan) and see that a line is generated to create a new production order.

If carried out again it will be obvious on the item card that there are double production orders.
Image

Additional context

This was an appoved bug in microsoft/BusinessCentralApps#1768. I think that was faulty closed when a pull request microsoft/BusinessCentralApps#1888 was closed, and I want to make a solution that can be approved, since this creates double demands today.

This bug is not as obscure as it might sound. The released production order can't be fully refreshed without removing the reservation first. Which results in a production order without reservation. After removing the reservation it's not possible to manually add the reservation. (Maybe this should be a bug/feature request)

The problem is most likely in function MatchAttributes() in codeunit 99000854 "Inventory Profile Offsetting". It creates a new req. line when there is no binding, but only removes supplies that has order-to-order binding. It's a very complex codeunit, so it will require careful investigation and testing.

I will provide a fix for a bug
  • I will provide a fix for a bug

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.