web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Filter Record

(0) ShareShare
ReportReport
Posted on by 3,099

Hi

  I have Main Form & Sub Form . Main Form Source Table is Location & Sub Form is Sale Line Table.  I have below code to filter record according to User Id Location . It should display only 1 record according to User Location . User should not be able to select any other Location. User should not be able to select Previous , Next buttons.


IF UserSetup.GET(USERID) THEN
BEGIN
UserSetup.TESTFIELD("Store No.");
IF (UserMgt.GetUserInfo2(USERID) <> '' )THEN BEGIN
SETRANGE("No.",UserMgt.GetUserInfo2(USERID));

END;
END;

Thanks

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Amol Salvi Profile Picture
    18,698 on at

    Where is issue ???

  • jsshivalik Profile Picture
    3,099 on at

    Hi

     When i pressed Next button it displays one more record but in non-editable mode which i don't want

    Thanks

  • Amol Salvi Profile Picture
    18,698 on at

    Paste the screenshot

  • Suggested answer
    npanchal Profile Picture
    on at

    User FILTERGROUP, before and after the SETRANGE, it will resolve your issues.

  • jsshivalik Profile Picture
    3,099 on at

    Hi

      Can u pls guide how it should be written . I have written like this but not working properly


    FILTERGROUP(2);
    SETRANGE("No.",UserMgt.GetUserInfo2(USERID));
    FILTERGROUP(0);

    Thanks

  • jsshivalik Profile Picture
    3,099 on at

    7853.Screen2.jpg7853.Screen2.jpg

  • jsshivalik Profile Picture
    3,099 on at

    Hi Amol

     I have added the screenshot

    Thanks

  • npanchal Profile Picture
    on at

    Which trigger are you putting your code?

  • jsshivalik Profile Picture
    3,099 on at

    Hi

    Form - OnInit()

    Thanks

  • npanchal Profile Picture
    on at

    Put it on Open Page.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans