Write to TableFilter field

chen_wanchen_wan Member Posts: 34
Hi all,

In Navision's Permissions Table there is a field called Security Filter,
which has a datatype of TABLEFILTER.

How can we update this field programatically. I tried the following but but hit an type conversion error. The "Security Filter" field is a TableFilter datatype.

Permission.SETRANGE("Object Type", Permission."Object Type"::"Table Data");
Permission.SETRANGE("Object ID", 5601);
Permission."Security Filter" := 'Fixed Asset: No.=COM/100000';
Permission.Modify;

When I tried to assign a text value to the Security Filter filter, the data type conversion error occurs. Anybody has any idea how to update a TableFilter field?




Thanks.

Comments

  • kinekine Member Posts: 12,562
    something like
    EVALUATE(Permission."Security Filter",''Fixed Asset: No.=COM/100000');
    

    does not help?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DavidBDavidB Member Posts: 11
    Hello,

    i have about the same problem.

    If i want to write the following code everything works fine:
    EVALUATE("Security Filter",'Customer: Test=1');
    


    But if i want to write this...
    EVALUATE("Security Filter",'Customer: Test=1|2');
    

    ... i get an error message.
    --> You cannot write "Customer: Test=1|2" into Integer.

    ](*,)
    Has anybody an idea?
  • kinekine Member Posts: 12,562
    What about double quote or apostrophe? Did you tried to enter this directly into security filters, if there are some added characters to delimit the filter?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.