Inventory Storewise in Nav 2016

omyvadiyaomyvadiya Member Posts: 124
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 Member Posts: 124
    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 Member Posts: 1,139
    What did you tried so far?
  • omyvadiyaomyvadiya Member Posts: 124
    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 Member Posts: 1,139
    Didn't you tried something handling with flowfields only??

  • omyvadiyaomyvadiya Member Posts: 124
    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 Member Posts: 417
    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 Member Posts: 124
    Yah i used it, and it is working fine.
  • omyvadiyaomyvadiya Member Posts: 124
    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 Member Posts: 417
    lp5j9jtjeotr.png
Sign In or Register to comment.