ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[W1][Report][6699][Move Negative Sales Lines] Replace FromDocType, ToDocType, and ToDocType2 Option variables with extensible Enums

Open mavohra opened this issue 4 months ago • 5 comments

Why do you need this change?

The Move Negative Sales Lines report uses the global variables FromDocType, ToDocType, and ToDocType2, all of which are of type Option to determine the supported document types.

Since Option variables are not extensible, partners and ISVs cannot introduce additional document types through a report extension. This forces direct Base Application modifications for scenarios that should otherwise be supported through extensibility.

Replacing these option variables with extensible enums would enable extension-based customizations while preserving the existing report behavior.

Describe the request

Our extension introduces additional sales document types that need to participate in the Move Negative Sales Lines process.

The report determines the source and destination document types using the global option variables FromDocType, ToDocType, and ToDocType2. Because these are Option variables, there is currently no supported way to add new document types through a report extension.

Replacing these variables with extensible enums would provide a supported extensibility point, allowing partners and ISVs to extend the report without requiring Base Application customizations. Internal work item: AB#642554

mavohra avatar Jul 13 '26 11:07 mavohra

Hi @mavohra,

Thank you for your extensibility request. To help us process it efficiently, please update the issue to include the required information.

📚 Extensibility Guidelines

Missing Information:

  • Enum definition: Please provide the full proposed enum definition for each replacement enum for FromDocType, ToDocType, and ToDocType2, including the enum name, all values, captions, and ordinals.

Please update the issue with the missing details. We'll automatically re-analyze once updated.

[!NOTE] Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.

[!TIP] Not accurate? Reply with /not-accurate (optional: add a short explanation). Your feedback improves future responses.

github-actions[bot] avatar Jul 13 '26 13:07 github-actions[bot]

Enum definition

Proposed replacement enums, preserving the exact ordinals/captions of the current Option values so the change is non-breaking for any existing callers (AssignmentCompatibility = true):

FromDocType

enum 6699 "Move Neg. Sales Lines From Type"
{
    Extensible = true;
    AssignmentCompatibility = true;

    value(0; Quote) { Caption = 'Quote'; }
    value(1; "Blanket Order") { Caption = 'Blanket Order'; }
    value(2; Order) { Caption = 'Order'; }
    value(3; Invoice) { Caption = 'Invoice'; }
    value(4; "Return Order") { Caption = 'Return Order'; }
    value(5; "Credit Memo") { Caption = 'Credit Memo'; }
}

ToDocType / ToDocType2

Both variables use the same six document types today (Option ,,"Order",Invoice,"Return Order","Credit Memo"), so one enum can serve both:

enum 6700 "Move Neg. Sales Lines To Type"
{
    Extensible = true;
    AssignmentCompatibility = true;

    value(0; Quote) { Caption = 'Quote'; }
    value(1; "Blanket Order") { Caption = 'Blanket Order'; }
    value(2; Order) { Caption = 'Order'; }
    value(3; Invoice) { Caption = 'Invoice'; }
    value(4; "Return Order") { Caption = 'Return Order'; }
    value(5; "Credit Memo") { Caption = 'Credit Memo'; }
}

mavohra avatar Jul 17 '26 11:07 mavohra

✅ Analysis complete - ready for further processing


Implementation:

Replace global variables FromDocType, ToDocType, and ToDocType2 in report 6699 Move Negative Sales Lines with extensible enums, using enum 6699 "Move Neg. Sales Lines From Type" for FromDocType and enum 6700 "Move Neg. Sales Lines To Type" for ToDocType and ToDocType2, preserving the current ordinals and captions with AssignmentCompatibility = true.

enum 6699 "Move Neg. Sales Lines From Type"
{
    Extensible = true;
    AssignmentCompatibility = true;

    value(0; Quote) { Caption = 'Quote'; }
    value(1; "Blanket Order") { Caption = 'Blanket Order'; }
    value(2; Order) { Caption = 'Order'; }
    value(3; Invoice) { Caption = 'Invoice'; }
    value(4; "Return Order") { Caption = 'Return Order'; }
    value(5; "Credit Memo") { Caption = 'Credit Memo'; }
}

enum 6700 "Move Neg. Sales Lines To Type"
{
    Extensible = true;
    AssignmentCompatibility = true;

    value(0; Quote) { Caption = 'Quote'; }
    value(1; "Blanket Order") { Caption = 'Blanket Order'; }
    value(2; Order) { Caption = 'Order'; }
    value(3; Invoice) { Caption = 'Invoice'; }
    value(4; "Return Order") { Caption = 'Return Order'; }
    value(5; "Credit Memo") { Caption = 'Credit Memo'; }
}

File: MoveNegativeSalesLines.Report.al

[!NOTE] Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.

[!TIP] Not accurate? Reply with /not-accurate (optional: add a short explanation). Your feedback improves future responses.

github-actions[bot] avatar Jul 17 '26 13:07 github-actions[bot]

Hello Ahmed Vohra (@mavohra),

Report "Move Negative Sales Lines" is pretty simple. Why do not you create your own version for specific scenarios you have?

AleksandricMarko avatar Sep 03 '26 10:09 AleksandricMarko

Closing as not planned. In case you still need it, please open new issue on BCApps (https://github.com/microsoft/BCApps/issues)

AleksandricMarko avatar Oct 16 '26 09:10 AleksandricMarko