code change · fixIntegration & APIsofficial - Microsoftreviewed - checked by Opus

#13623 [Dataverse] Fix duplicate sales line numbers with automatic recurring lines

Fixed an issue where creating a Business Central sales order from Dynamics 365 Sales could fail with duplicate line numbers when automatic recurring lines already existed. The importer now initializes the line counter from the last existing sales line instead of starting from zero.

Pull request · merged into main (BC30) on 2026-11-06 by gggdttt · 2 files (+175 -0), 1 AL · fix · tier official · reviewed (checked by Opus)

What changed

  • LastSalesLineNo counter is now initialized from the last existing sales line for the document
  • Counter is reset for every order to prevent number conflicts
  • In-memory allocation logic preserved to prevent extended description lines from reusing main line numbers
  • Existing recurring lines are preserved during import
  • Regression tests added covering single recurring line, multiple recurring lines with products and descriptions, and successive orders
  • Behaviour changes for users or extensions.

AL objects touched

Context

  • Work items: AB#654747
  • Labels: Team: Integrations
  • Systems: integration

No source states these links: they share an object, a model read them, or a person found the same subject.

  • Standard recurring sales lines — possibly related: Documents standard recurring sales lines feature that automatic recurring lines implement. (model-linked)

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).