SETFILTER Question

earldelrosarioearldelrosario Member Posts: 6
Hi All,

I'm new with NAV coding please help about SETFILTER. I have an issue and i was hoping SETFILTER can help me, here is the scenario:

User Setup Table Contains:
Username | Shortcut Dimension 1 Code
User1 | Comp1
User2 | Comp2

Now the Page currently showing all in either User logged:
No | Qty | Shortcut Dimension 1 Code
0001 | 2 | Comp1
0002 | 12 | Comp2
0003 | 20 | Comp2


What I want to show in the Page:
If User1 is logged on
No | Qty | Shortcut Dimension 1 Code
0001 | 2 | Comp1

If User2 is logged on
No | Qty | Shortcut Dimension 1 Code
0002 | 12 | Comp2
0003 | 20 | Comp2


How do I code it using SETFILTER. From what I've read all samples for SETFILTER are constant values.

Thank you.

Best Answer

  • AlbertvhAlbertvh Member Posts: 516
    Answer ✓
    Hi,
    In the OnOpenPage you could write something like this

    IF UserSetup.get(USERID) THEN
    SETRANGE("Shortcust Dimension 1 Code",UserSetup."Shortcut Dimension 1 Code");

Answers

  • AlbertvhAlbertvh Member Posts: 516
    Answer ✓
    Hi,
    In the OnOpenPage you could write something like this

    IF UserSetup.get(USERID) THEN
    SETRANGE("Shortcust Dimension 1 Code",UserSetup."Shortcut Dimension 1 Code");
  • earldelrosarioearldelrosario Member Posts: 6
    It works!!!

    Thank you Albertvh.
Sign In or Register to comment.