Skip to main content

Notifications

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

  • Community Member Profile Picture
    on at
    RE: How to check if a table is locked in Nav

    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

  • Suggested answer
    keoma Profile Picture
    32,727 on at
    RE: How to check if a table is locked in Nav

    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
    RE: How to check if a table is locked in Nav

    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

  • Community Member Profile Picture
    on at
    RE: How to check if a table is locked in Nav

    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

  • Suggested answer
    Jatin Patel Profile Picture
    2,641 on at
    RE: How to check if a table is locked in Nav

    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.

  • Suggested answer
    RockwithNav Profile Picture
    6,833 on at
    RE: How to check if a table is locked in Nav

    Hey Hungto,

    Check out his link if it helps you.

    dynamicsuser.net/.../62972

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics NAV (Archived)

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2

#1
mmv Profile Picture

mmv 2

#1
Amol Salvi Profile Picture

Amol Salvi 2

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans