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.
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.
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.
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.
Answers
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.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
I was asking if NAV has something standard for it like in codeunits but your answer goes beyond that, thanks.
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.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03