Skip to content

[Subscription Billing] Page 8002 "Extend Contract" — move key variables to protected var and add setters for PageExtension automation#9715

Open
pamura1977 wants to merge 1 commit into
microsoft:mainfrom
pamura1977:fix/8856-protected-var-extend-contract
Open

[Subscription Billing] Page 8002 "Extend Contract" — move key variables to protected var and add setters for PageExtension automation#9715
pamura1977 wants to merge 1 commit into
microsoft:mainfrom
pamura1977:fix/8856-protected-var-extend-contract

Conversation

@pamura1977

@pamura1977 pamura1977 commented Jul 24, 2026

Copy link
Copy Markdown

What & why

Page 8002 "Extend Contract" only exposed a limited set of variables in its protected var section, leaving several variables that partner extensions need to read or write in the global (unprotected) var block. This blocked automation scenarios on top of the standard "Extend Contract" flow without cloning the entire page.

This change moves seven variables (CustomerContractNo, VendorContractNo, SubscriptionDescription, ItemDescription, UnitPrice, UnitCostLCY, ProvisionStartDate) to protected var, and adds two new setter procedures (SetVendorContractParameters(), SetItemParameters()) following the existing SetUsageBasedParameters() pattern, so that a PageExtension can supply these values before OnOpenPage runs its validation chain, ensuring dependent fields (item description, unit price/cost, subscription packages) are populated correctly instead of appearing empty.

Linked work

Fixes #8856

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app locally with no new analyzer warnings.

What I tested and the outcome

  • Compiled the "Subscription Billing" app locally (AL: Package) against a BC 29 Early Access Preview sandbox (29.0.52714.0); build succeeded ("Success: The package is created"). The only compiler warnings (AL0920, in RecentItemPrice/CalculationBaseByPerc/PriceByPercent codeunits) are pre-existing in main and unrelated to this change.
  • Given the small, additive scope of this change (visibility change + two new setters following an existing, already-used pattern), I did not further test this in a Business Central instance.

Risk & compatibility

None expected. All changes are additive:

  • Moving variables from var to protected var does not change any existing behavior for the base app or existing callers. It only widens accessibility for PageExtensions.
  • The two new setter procedures are new public entry points; no existing procedure signature is modified.
  • The one behavioral addition (re-applying VariantCodeParam at the end of OnOpenPage) is guarded by if VariantCodeParam <> '', so existing manual-entry behavior (no parameters supplied) is unchanged.

…geExtension automation

Fixes issue microsoft#8856:
- Move CustomerContractNo, VendorContractNo, SubscriptionDescription, ItemDescription, UnitPrice, UnitCostLCY, ProvisionStartDate from global var to protected var
- Add SetVendorContractParameters() and SetItemParameters() following the existing SetUsageBasedParameters() pattern
- Extend SetGlobalsFromParameters() with the corresponding assignments
- Preserve programmatically supplied VariantCode after ValidateItemNo() resets it
@pamura1977
pamura1977 requested a review from a team July 24, 2026 12:08
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork Finance GitHub request for Finance area labels Jul 24, 2026
@pamura1977

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="redPoint AG"

@github-actions github-actions Bot added the needs-approval Workflow runs require maintainer approval to start label Jul 24, 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 needs-approval Workflow runs require maintainer approval to start

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: [Subscription Billing] Page 8002 "Extend Contract" — Move key page variables to protected var to enable partner extensions via PageExtension

1 participant