microsoft / microsoft/BCApps

[Extensibility Request] "SetSwissExport" on Table 1226 "Payment Export Data" is scoped "OnPrem", blocking Cloud extensions

Open Beginner friendly
#10,731 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Approved request-for-external Team: Finance
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.
  • SetSwissExport is the only OnPrem-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
  1. Create an AL extension with app.json "target" set to "Cloud" (or no "target" specified, which defaults to Cloud-compatible).
  2. Add a codeunit that declares a variable of type Record "Payment Export Data" (table 1226).
  3. Call PaymentExportData.SetSwissExport(true) on that variable.
  4. 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

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.