Remove a locktable

yekede
yekede Member Posts: 96
Hello,
Please can someone tell me how to remove a lock on a table?
I placed the lock using "record.locktable" syntax. i would like to know how to remove it within the code.
Thanks

Answers

  • kine
    kine Member Posts: 12,562
    Remove? It will be removed when the transaction ends. If you need to prevent "locking" (when user see the info tat the table is locked", you need to make the transaction as short as possible by optimizing the hardware and the application.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DenSter
    DenSter Member Posts: 8,307
    yekede wrote:
    I placed the lock using "record.locktable" syntax
    How did you do that? Did you put that code under a button, or are you talking about a locktable command inside some codeunit as part of some process?
  • bylle
    bylle Member Posts: 47
    Hi!

    When tables are locked by a transaction, they will remain locked until one of the following situations occurs:
    1) The transactions ends (as kine mentioned)
    2) A COMMIT occurs
    3) An error statement (a rollback) occurs.

    A COMMIT during a transaction is a no go - unless you are sure, that you want to start a new transaction.
  • yekede
    yekede Member Posts: 96
    Thanks! its ok now
  • David_Singleton
    David_Singleton Member Posts: 5,479
    yekede wrote:
    Thanks! its ok now

    So since so many community members have helped you, it might be fair if you explained how you solved the issue, and give something back.
    David Singleton
  • yekede
    yekede Member Posts: 96
    Hi,
    it was removed at the end of the transaction. Thanks