Skip to content

Conversation

@miljance
Copy link
Contributor

@miljance miljance commented Jan 30, 2026

Summary

This pull request introduces improvements to the deletion logic for subscription headers and adds comprehensive tests to ensure correct handling of associated subscription lines. The main focus is to ensure that unassigned subscription lines are deleted when their header is deleted, while headers with assigned lines are protected from deletion.

Deletion logic improvements

  • Added a missing SetRange("Subscription Contract No.") filter before deleting service commitments in table 8057 "Subscription Header" to ensure only relevant records are deleted.

Test coverage enhancements

  • Added a test to verify that unassigned subscription lines are deleted when their subscription header is deleted in codeunit 148157 "Service Object Test".
  • Added a test to ensure an error is raised when attempting to delete a subscription header with subscription lines assigned to a contract, protecting data integrity.

Work Item(s)

Fixes #6314

Fixes AB#620365

@miljance miljance requested a review from a team as a code owner January 30, 2026 16:58
@github-actions github-actions bot added AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork labels Jan 30, 2026
@miljance miljance changed the title Subscription Lines Deletion Fix [Subscription Billing]Subscription Lines Deletion Fix Jan 30, 2026
@JesperSchulz JesperSchulz added the Linked Issue is linked to a Azure Boards work item label Feb 2, 2026
@JesperSchulz JesperSchulz self-assigned this Feb 2, 2026
@JesperSchulz JesperSchulz added the Finance GitHub request for Finance area label Feb 2, 2026
@github-actions github-actions bot added this to the Version 28.0 milestone Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Finance GitHub request for Finance area From Fork Pull request is coming from a fork Linked Issue is linked to a Azure Boards work item

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Subscription Billing] Subscription Lines not deleted when Subscription Header is deleted

3 participants