Singleinstance page
KTA8
Member Posts: 399
Is it possible to perform that a page can be opened only one time for all users or per user?
0
Best Answer
-
You would need to implement some sort of "semaphore" buffer table, and check if record for a given user exists in a record in an OnOpenPage trigger. If yes, record exists already throw an error preventing a page from being open. If no user specific record yet insert a new one, remembering the userid in it
The semaphore record from the semaphore should be removed in OnClosePage trigger
That would ensure that even if a user has a few sessions open given page can be opened only once.
But this sort of construction can cause problems if NAV client, or the page, crashes and the OnClosePage trigger is not executed properly and the semaphore record is non removed. If this happens the user will not be able to open the page anymore, until someone clears his record in the semaphore table.
Slawek Guzek - www.yitron.co.uk
Business Central, MS SQL Server, Wherescape RED;5
Answers
-
You would need to implement some sort of "semaphore" buffer table, and check if record for a given user exists in a record in an OnOpenPage trigger. If yes, record exists already throw an error preventing a page from being open. If no user specific record yet insert a new one, remembering the userid in it
The semaphore record from the semaphore should be removed in OnClosePage trigger
That would ensure that even if a user has a few sessions open given page can be opened only once.
But this sort of construction can cause problems if NAV client, or the page, crashes and the OnClosePage trigger is not executed properly and the semaphore record is non removed. If this happens the user will not be able to open the page anymore, until someone clears his record in the semaphore table.
Slawek Guzek - www.yitron.co.uk
Business Central, MS SQL Server, Wherescape RED;5 -
Slawek_Guzek wrote: »You would need to implement some sort of "semaphore" buffer table, and check if record for a given user exists in a record in an OnOpenPage trigger. If yes, record exists already throw an error preventing a page from being open. If no user specific record yet insert a new one, remembering the userid in it
The semaphore record from the semaphore should be removed in OnClosePage trigger
That would ensure that even if a user has a few sessions open given page can be opened only once.
But this sort of construction can cause problems if NAV client, or the page, crashes and the OnClosePage trigger is not executed properly and the semaphore record is non removed. If this happens the user will not be able to open the page anymore, until someone clears his record in the semaphore table.
I was asking if NAV has something standard for it like in codeunits but your answer goes beyond that, thanks.0 -
No, nothing in standard NAV.
I've had same requirement quite some time ago, implemented just that, and every so often had to clean the semaphore table. I woudn't try to implement such a solution now, I would rather try to spend my time with users training them.Slawek Guzek - www.yitron.co.uk
Business Central, MS SQL Server, Wherescape RED;0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
