Inventory Storewise in Nav 2016

omyvadiyaomyvadiya Posts: 97Member
Hi,
By using the inventory field of Item table, one can get the inventory of all the stores.

I have to somehow show the user, inventory of his/her Store ONLY.

Actually my idea is to create a location field in user setup, and by assigning a Location to the user and then the inventory must be filtered as per that location field of User table.

Thanks in Advance

Best Answer

  • omyvadiyaomyvadiya Posts: 97
    Accepted Answer
    This code worked for me on the OnAftergetrecord of the Item balance Page & on ILE pages OnOpenPage:

    FILTERGROUP(2);
    IF UserSetupRec.GET(USERID) THEN BEGIN
    IF (UserSetupRec."Location Code 1" <>'' ) OR (UserSetupRec."Location Code 2" <>'')
    OR (UserSetupRec."Location Code 3" <>'') OR (UserSetupRec."Location Code 4" <>'') THEN
    SETFILTER("Location Filter",'%1|%2|%3|%4',UserSetupRec."Location Code 1",UserSetupRec."Location Code 2",
    UserSetupRec."Location Code 3",UserSetupRec."Location Code 4");
    IF (UserSetupRec."Location Code 1" ='' ) AND (UserSetupRec."Location Code 2" ='')
    AND (UserSetupRec."Location Code 3" ='') AND (UserSetupRec."Location Code 4" ='') THEN
    FILTERGROUP(0);
    END

Answers

  • RockWithNAVRockWithNAV Posts: 822Member
    What did you tried so far?
  • omyvadiyaomyvadiya Posts: 97Member
    Accepted Answer
    This code worked for me on the OnAftergetrecord of the Item balance Page & on ILE pages OnOpenPage:

    FILTERGROUP(2);
    IF UserSetupRec.GET(USERID) THEN BEGIN
    IF (UserSetupRec."Location Code 1" <>'' ) OR (UserSetupRec."Location Code 2" <>'')
    OR (UserSetupRec."Location Code 3" <>'') OR (UserSetupRec."Location Code 4" <>'') THEN
    SETFILTER("Location Filter",'%1|%2|%3|%4',UserSetupRec."Location Code 1",UserSetupRec."Location Code 2",
    UserSetupRec."Location Code 3",UserSetupRec."Location Code 4");
    IF (UserSetupRec."Location Code 1" ='' ) AND (UserSetupRec."Location Code 2" ='')
    AND (UserSetupRec."Location Code 3" ='') AND (UserSetupRec."Location Code 4" ='') THEN
    FILTERGROUP(0);
    END

  • RockWithNAVRockWithNAV Posts: 822Member
    Didn't you tried something handling with flowfields only??

  • omyvadiyaomyvadiya Posts: 97Member
    Hi,
    i tried but it didn't worked, last option was using filtergroup filtering on the page.
    I think using Inventory flowfields and Location Filter Flowfilter might work...
  • TallyHoTallyHo Posts: 156Member
    edited 2019-04-05
    There is a field "Location Filter" in the item table.
    This is a special field, the sole purpose is to filter flowfields that have the filter field added to their properties. In pages this is caled the flow filter.

    So just filter item.setrange("location filter",usersetup."location code");

    Edit: you used this field i see now. So it should work.
  • omyvadiyaomyvadiya Posts: 97Member
    Yah i used it, and it is working fine.
  • omyvadiyaomyvadiya Posts: 97Member
    edited 2019-04-08
    Hi,
    Can anyone tell me from where i can close this query, as it is solved, i tried editing the first question of this issue trail, but couldn't find any Solved option.


    PFA
  • TallyHoTallyHo Posts: 156Member
    lp5j9jtjeotr.png
Sign In or Register to comment.