Singleinstance page

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

Best Answer

Answers

  • KTA8
    KTA8 Member Posts: 399
    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_Guzek
    Slawek_Guzek Member Posts: 1,692
    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;