Singleinstance page

KTA8KTA8 Posts: 208Member
Is it possible to perform that a page can be opened only one time for all users or per user?

Best Answer

Answers

  • KTA8KTA8 Posts: 208Member
    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.
  • Slawek_GuzekSlawek_Guzek Posts: 1,612Member
    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
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Sign In or Register to comment.