web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to check if a table is locked in Nav

(0) ShareShare
ReportReport
Posted on by

Hi,

Now, when I run a report sometimes I get error table xxx is locked; and it terminates.

Do we have any method in Nav; where we can check if a table is currently locked? then we can set wait until it unlocks ?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    RockwithNav Profile Picture
    8,637 Super User 2025 Season 2 on at

    Hey Hungto,

    Check out his link if it helps you.

    dynamicsuser.net/.../62972

  • Suggested answer
    Jatin Patel Profile Picture
    2,641 on at

    Hi,

    Here is a script to identify locked tables in the SQL Server.

    SELECT

    OBJECT_NAME(p.OBJECT_ID) AS TableName,

    resource_type, resource_description

    FROM sys.dm_tran_locks l

    JOIN sys.partitions p ON l.resource_associated_entity_id = p.hobt_id

    When you run above script, it will display table name and lock on it.

  • Community Member Profile Picture
    on at

    Thank you!

    But I need somethings that I can embedded in my report. Because when our users run the report, they cannot run script and check. I want the report to check and response correspondingly

  • Community Member Profile Picture
    on at

    Hi,

    thanks for your reply: but I see the below question still pending.

    Honestly, I haven't because I was wondering if there is a way of doing something like:

    How I can do below task ?

    IF table_is_locked THEN

     skip_posting

    ELSE

     insert_record

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    you could run jatin's code using ADO in c/al.

    for that follow my blog post moxie4nav.wordpress.com/.../executing-sql-select-statement-in-cal

  • Community Member Profile Picture
    on at

    I tried the locktable but it doesn't work. I set the wait to true, and expect the report will wait but still run time error

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans