microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
719 stars 242 forks source link

Custom Filter Token do not work for GUID Fields #7728

Closed ChrisBlankDe closed 2 months ago

ChrisBlankDe commented 2 months ago

Please include the following with each issue:

1. Describe the bug Custom Filter Token do not work for GUID Fields

2. To Reproduce Steps to reproduce the behavior:

  1. Implement an Custom Filter for a GUID Field.
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Filter Tokens", 'OnResolveTextFilterToken', '', true, true)]
    local procedure OnResolveTextFilterToken2(TextToken: Text; var TextFilter: Text; var Handled: Boolean)
    begin
        if StrLen(TextToken) < 5 then
            exit;
        if StrPos(UpperCase('MYFILTER'), UpperCase(TextToken)) = 0 then
            exit;
        Handled := true;
        TextFilter := '{00000000-0000-0000-0000-000000000001}'
    end;
  2. Test the custom filter token on the modified by field on customer card. image

Note: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.

3. Expected behavior I Expect the custom filter tokens to work for guid fields like any other data type

4. Actual behavior An Error Message is shown: image The filter "%MYFILTER" is not valid for the Modified By field on the Customer table. The variable "%MYFILTER" was not understood.

5. Versions:

Final Checklist

Please remember to do the following:

thloke commented 2 months ago

Hi, this issue is out of scope of for this repository. You should do one of the following:

As a reminder, this repository only handles issues to do with the compiler or VSCode development experience for AL.