Options

Copystr without | Sign

omyvadiyaomyvadiya Member Posts: 124
edited 2019-03-26 in NAV Three Tier
Hi,
How can i copy the values of a string without the |(pipe) sign.

MGR|MTP|MOP

i need to filter with MGR or MTP or MOP on a page, these values can change


i am trying the following code, but i am missing something

FILTERGROUP(2);
UserSetupRec.GET(USERID);
LocCode := COPYSTR(UserSetupRec."Location Code",STRPOS(UserSetupRec."Location Code",'|')-1);
MESSAGE('LocCode - %1,STRPOS(UserSetupRec."Location C - %2',LocCode,STRPOS(UserSetupRec."Location Code",'|')-1);
SETFILTER("Location Filter",'=%1',UserSetupRec."Location Code");
FILTERGROUP(0);

Thanks in advance

Answers

  • Options
    mohana_cse06mohana_cse06 Member Posts: 5,503
    why do you need to copy?
    isn't it working directly?

    SETFILTER("Location Filter",'=%1',UserSetupRec."Location Code");
  • Options
    omyvadiyaomyvadiya Member Posts: 124
    Hi @mohana_cse06 -
    No, it is not picking any value on the page.

    Actually i have created a new field of Location code on user setup, and i want the user to see only his her location inventory on item list.

    so i an written the above code OnAftergetRecord of Item list,for one locaiton code it is working fine, but i enter multiple location codes for a single user, the page is blank

    Thanks
  • Options
    AlexDenAlexDen Member Posts: 85
    Hi,

    Maybe, you try to filter by wrong field?
    "Location Filter" looks like FlowFilter field, perhaps, you have to filter by "Location Code".
  • Options
    omyvadiyaomyvadiya Member Posts: 124
    Hi @AlexDen ,
    As far as i know, there is only Location filter (Flowfilter) in Item table.
Sign In or Register to comment.