Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Set filter for Sales List Page

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Dear Experts,

Our NAV users must input the USER ID on the Sales Order.

We would like to set a default filter on the Sales Order List which allows the person who login with the same USER ID to view the Sales Order on the Sales Order List.

e.g. 

DOMAIN\USER1 created SO0001

DOMAIN\USER2 created SO0002

When DOMAIN\USER1 opens the Sales Order List, he can only view and open SO0001.

DOMAIN\USER1 must not be allowed to change the filter/clear the filter to see DOMAIN\USER2 sales orders.

Is there any possible ways to do so? (We don't mind adding any C/AL code to do the filter on the sales page)

Thanks

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Set filter for Sales List Page

    Thanks all

  • Suggested answer
    Alexander Ermakov Profile Picture
    Alexander Ermakov 28,094 on at
    RE: Set filter for Sales List Page

    Agree with Nareshwar.

    In addition, you should also consider a scenario when the user who creates the Sales Order is not necessarily the person who would need to view or process that further (not sure if you have these, but anyway). E.g., some sales director/manager who need to process all the sales orders. Or, when one person leaves the company and his customers are now transferred to his colleague. How would you deal with that?

    Having some basic rules hardcoded into the page would limit your capabilities in processing such deviations from the "normal" process, or you would need to think how you would handle them in advance.

    So, ideally, there should be some additional setup where you would define the rules for different users, who can see different sales orders - only their own or others as well, and assign corresponding restrictions.

  • Suggested answer
    RE: Set filter for Sales List Page

    Hi Kelvin,

    There are few options you can possibly try.

    1. I do not recommend adding code to the OnOpenPage() since when you are creating new Sales Order, these filters will be applied, and you will face constant errors/warnings, plus the USERID isn't the primary key.

    As a workaround, you can create a new Sales Order List Page, taking a copy of the default Sales Order List Page, then apply the code. So, you can have the default page for creation of Sales Order, and the newly added page for your controls, with the help of security filters.

    2. Check if you can assign Responsibility Centers to each user, so it can cater your requirement. Check here:

    msdn.microsoft.com/.../hh179498(v=nav.90).aspx

    msdn.microsoft.com/.../hh172904(v=nav.90).aspx

  • Verified answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Set filter for Sales List Page

    You can add the code on the page OnOpenPage

    UserSetup.SETRANGE(UserSetup."User ID",USERID);

    IF UserSetup.FINDFIRST THEN BEGIN

       SETRANGE(Userid,USERID);

    END;

    You need to add field userid in Sales Header

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans