Security Filter with OR

johannajohanna Member Posts: 369
Dear all,

Is it possible to set security filter in table Item : Item Category Group = AAA OR Product Group Code = XYZ ?

Item No | Item Category Group | Product Group Code
Item1 | AAA | XXX
Item2 | BBB | XYZ
Item3 | CCC | XXX

So, Item1 & Item2 will be shown..
Is it possible? If yes, please show me the way...
Thanks..
Best regards,

Johanna

Comments

  • kinekine Member Posts: 12,562
    No.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • GRIZZLYGRIZZLY Member Posts: 127
    What about creating additional column for that purposes?
    On modifying record value of that field should assigned to concantenation of 2 fields. For example:
    OnModify
    Hash := "Item Category Group" + ';' + "Product Group Code";

    For security we should filter field Hash with the expression:
    AAA;*|*;XYZ
    Sincerely yours, GRIZZLY
    Follow my blog at http://x-dynamics.blogspot.com
  • kinekine Member Posts: 12,562
    Yes, you can change the case by creating new field and moving the problem from "multi-field condition" to "one-field condition" case and solve it by standard sec. filters...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • johannajohanna Member Posts: 369
    Thanks Kine & GRIZZLY...

    What a great idea GRIZZLY :)
    I'll try it.. But, * cannot be used in security filter.. correct me if I'm wrong ;)
    So, how I can set security filter like you said (AAA;*|*;XYZ) ? :D
    Best regards,

    Johanna
  • GRIZZLYGRIZZLY Member Posts: 127
    It seems, that you're right:
    Important
    Record level security filters do not support wildcards. This means that you cannot use * and ? in the filters. You can use the other symbols and operators, such as, <, >, |, &, and =.
    So, right now I don't have an idea about problem solution... :-k I should think about it...
    Sincerely yours, GRIZZLY
    Follow my blog at http://x-dynamics.blogspot.com
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    I see two possibilities to get around this issue:
    1. Apply the filter to the new field by NAV code.
    2. Create a boolean field "Visible for security user" and set it when either "Item Category Group" is set to AAA or "Product Group Code" is set to XYZ. Perhaps you have to create some kind of setup where you can define the values of "Item Category Group" and "Product Group Code" that should set field "Visible for security user".


    Btw, I remember there were some performance issues with security filter. Is that solved? In which version?
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • johannajohanna Member Posts: 369
    GRIZZLY wrote:
    It seems, that you're right:
    Important
    Record level security filters do not support wildcards. This means that you cannot use * and ? in the filters. You can use the other symbols and operators, such as, <, >, |, &, and =.
    So, right now I don't have an idea about problem solution... :-k I should think about it...


    It's okay GRIZZLY.. ;)
    Thank you for your help ;)
    Best regards,

    Johanna
  • johannajohanna Member Posts: 369
    I see two possibilities to get around this issue:
    1. Apply the filter to the new field by NAV code.
    2. Create a boolean field "Visible for security user" and set it when either "Item Category Group" is set to AAA or "Product Group Code" is set to XYZ. Perhaps you have to create some kind of setup where you can define the values of "Item Category Group" and "Product Group Code" that should set field "Visible for security user".


    Btw, I remember there were some performance issues with security filter. Is that solved? In which version?

    Hi einsTeIn.NET,

    Thanks for your suggestion.
    Yes, I think to solve this issue is modify NAV code. Prepare new table for setup the filter, then check the user and compare with the setup with NAV code.
    The standard security filter NAV cannot be used for OR condition.. :(

    Which the performance issues with security filter did you mean? Please refer me the link of post.. :)
    Best regards,

    Johanna
Sign In or Register to comment.