GETFILTERS with description

ImreImre Member Posts: 10
Hello ,

Is there any simple way to get filter with not the filtered key-code in any table but the description field from the table ?

example:
the filter is "LOCATION CODE = 110"
GETFILTERS give me back "LOCATION CODE: 110 "
but I need "LOCATION: Store1 in Budapest"

.. or I have to cut the filter string and find the description from the table ...

Thanks for the answer

Imre

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    I am affraid you need to write some function for this.
  • kinekine Member Posts: 12,562
    For example some function which will use RecordRef and FieldRef and TABLERELATION for doing that... it is not so hard... but I have no time for that now... ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • nishandesainishandesai Member Posts: 23
    What you can do is First take a variable with text filed eg loc

    loc := "Table".GETFILTER("Location Code");

    after that on pre section of the report where u want to keep it. Take the recordset of location table and setrange it with the "TABLE" and then if loc <> '' then through set range u get the name, this way u will be able to get the name,

    same thing i did for Country too
  • KowaKowa Member Posts: 925
    Something like this should work, but only for filtering one location :
    If Getfilter("Location code") <> '' then begin
    if Location.get("Location code") then
    Filtertext := Location.Tablecaption +':'+ Location.Description
    else
    error('A valid single location must be entered');
    end;
    Kai Kowalewski
  • ShenpenShenpen Member Posts: 386
    I agree with Kowa. Anyway, I would catch this error somewhere earlier, because it is a little bit fragile solution. You know some user some day will surely filter for STORE1|STORE2 and then you got an angry phone call :D

    If it is a report, I would create a field on the req. form with a variable and filter by hand in OnPreDataitem instead of having the user use the standard filters.

    Do It Yourself is they key. Standard code might work - your code surely works.
Sign In or Register to comment.