[Extensibility Request] "SetSwissExport" on Table 1226 "Payment Export Data" is scoped "OnPrem", blocking Cloud extensions
Nobody has claimed this yet.
- Dominant language
- AL
- Stars
- 683
- Forks
- 459
- Avg merge
- 3d 26m
- Merged PRs (30d)
- 633
Description
Describe the issue
Summary
Table 1226 "Payment Export Data" exposes the procedure SetSwissExport(NewSwissExport: Boolean) decorated with [Scope('OnPrem')]. Any AL extension targeting Business Central Online (SaaS) that calls this procedure fails to compile with:
AL0296: The application object or method 'SetSwissExport' has scope 'OnPrem' and cannot be used for 'Cloud' development.
Where
- Object:
Table 1226 "Payment Export Data" - Procedure:
SetSwissExport(NewSwissExport: Boolean)
Why this looks unintentional rather than deliberate
- The underlying field it sets,
SwissExport(Boolean), is not itself scope-restricted. - Every other setter procedure on the same table (e.g.
SetCreditorIdentifier,SetCreditTransferIDs,SetBankAsSenderBank) is unrestricted and callable from Cloud extensions. SetSwissExportis the onlyOnPrem-scoped member on this table. That inconsistency suggests either a legacy leftover or an oversight, rather than an intentional platform restriction.
Impact
Extensions implementing Swiss payment/SEPA (ISO 20022 credit transfer) export logic cannot call SetSwissExport when built for Business Central Online. This forces fragile workarounds (e.g. re-implementing the field via a table extension, or using reflection) instead of using the table's own encapsulating setter.
Suggested fix
Remove the [Scope('OnPrem')] attribute from SetSwissExport, bringing it in line with the other public setters on this table. A corresponding pull request is linked below.
Expected behavior
SetSwissExport(NewSwissExport: Boolean) on Table 1226 "Payment Export Data" should be callable from AL extensions that target Business Central Online (Cloud).
The procedure only assigns a Boolean value to the SwissExport field - it has no dependency on OnPrem-only APIs. The field itself, and every other setter on the same table (SetCreditorIdentifier, SetCreditTransferIDs, SetBankAsSenderBank, etc.), are not scope-restricted, so SetSwissExport should not be either.
Steps to reproduce
- Create an AL extension with app.json "target" set to "Cloud" (or no "target" specified, which defaults to Cloud-compatible).
- Add a codeunit that declares a variable of type Record "Payment Export Data" (table 1226).
- Call PaymentExportData.SetSwissExport(true) on that variable.
- Compile the extension.
Result: compilation fails with:
AL0296: The application object or method 'SetSwissExport' has scope 'OnPrem' and cannot be used for 'Cloud' development.
Additional context
No response
I will provide a fix for a bug
- I will provide a fix for a bug
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at Table 1226 "Payment Export Data" and inspect SetSwissExport(NewSwissExport: Boolean) alongside the other setter procedures named in the issue. Reproduce the AL0296 error with a Cloud-targeted extension, then verify the procedure is callable and the extension compiles successfully when the scope matches the other setters.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100