Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Filter OnOpenPage

(0) ShareShare
ReportReport
Posted on by

Hi,

Customer have ALOT of items, but they only use about 1000 of them manually and the rest is used though webservice and automaticed processes.

So ect. when on a sales order it can be really slow sometimes to search for a item because there are so many to search though.

I have onOpenPage (page Item List) made a setrange on the 1000 items i want to show, but this will effect everwhere that the item list is used, can this be done so it will only happend on sales orders for example?

What I had in mind was to create a function on Item List page with a boolean variable that only will set this to true.

SetBooleanTrue()
BooleanVar := True;

OnOpenPage
If BooleanVar = TRUE THEN
SETRANGE(MYSETRANGE, SETRANGE);

On Sales Order page I will call SetBooleanTrue() and i will get the right filter.

I tried this but its not working. Any hints on getting this to work only from ect. sales order and not affecting everywhere you use item list? 
Thanks in advance.

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Filter OnOpenPage

    If I understood you correctly you want to choose filtered item list only from Sales docs.

    May be the easiest way in this case is to modify Property "TableRelation" of the field "No." in table 37. Just specify filter for Type "Item"?

  • Suggested answer
    Youssef M Nasser Profile Picture
    20 on at
    RE: Filter OnOpenPage

    Hello Christopher,

    I believe that perhaps there's a better approach but you can try the following:

    Create a CodeUnite and set the "SingleInstance" property to yes, this will make all codeunit variables that use this CodeUnite use the same instance.

    In this CodeUnite create a variable "BooleanVar" and create a function to set this var to true "SetBooleanTrue()" and false "SetBooleanFalse()".

    In the Sales Order (or any other sales document you want) call the SetBooleanTrue() function on open page and call the SetBooleanFalse() on close.

    On another hand, in the Item List page check this value, if true do your filter if not do nothing.

    I hope this could help you.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans