DavidFeldhoff / al-codeactions

MIT License
17 stars 8 forks source link

AddOnBefore publisher ignores "." in variable names #146

Closed fvet closed 1 year ago

fvet commented 1 year ago

When running the 'AddOnBeforePublisher' code action on below function ...

local procedure ShowDetails(Type: enum "Purchase Line Type"; "No.": Code[20])

... the "." is stripped from the variable name.

image

Resulting in an invalid publisher call.

image

PS: Would be good if the publisher arguments would take over the original variable name (respecting the dot)

DavidFeldhoff commented 1 year ago

Well said :D I agree that it would be "nice" to have working code afterwards :D Let me look into it

DavidFeldhoff commented 1 year ago

It should be fixed now with v1.0.24 :)

fvet commented 1 year ago

Tested and approved! Thanks for the quick fix.

local procedure MyProcedure("No.": code[20]; "Field_": Code[20]; "Description/Name": code[20]; " Space": code[20])
    var
        IsHandled: Boolean;
    begin
        OnBeforeMyProcedure("No.", "Field_", "Description/Name", " Space", IsHandled);
        if IsHandled then
            exit;

        OnAfterMyProcedure("No.", "Field_", "Description/Name", " Space");
    end;