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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Checking for lock records in SOP100 and SOP10200

(0) ShareShare
ReportReport
Posted on by 75,848 Moderator

I have an import that runs automatically using Task Scheduler that imports changes to sales orders using eConnect. Every now and then the task will time out. I suspect it may be because someone is accessing a sales order that is in the import file. What is the best way to sense if an order is currently in use?

Categories:
I have the same question (0)
  • Tim Wappat Profile Picture
    5,703 on at
    RE: Checking for lock records in SOP100 and SOP10200

    It was new to me that it doesn't honour locks, so thanks for teaching me that.

    I guess I would check the tempdb..DEX_LOCK table and raise a custom econnect error code with

       @O_iErrorState int output,

       @oErrString varchar(255) output

    if a lock row is present, using the pre-econnect procedure to do the checking. You only lock order header then the order is yours.

    Untested output from brain goes soemething like..

    IF EXISTS

    (

    SELECT 1 FROM tempdb..dex_lock  

       WHERE table_path_name = db_name( )+'.dbo.SOP10100'

        AND row_id =

    (SELECT MSTRNUMB=DEX_ROW_ID FROM SOP10100 WHERE SOPNUMBE = @SOPNUMBE AND SOPTYPE = @SOPTYPE)

    )

    BEGIN

    SELECT 1; --Do whatever to raise exception here setting output variables for errorstate etc

    END

  • Richard Wheeler Profile Picture
    75,848 Moderator on at
    RE: Checking for lock records in SOP100 and SOP10200

    Thanks Tim, as usual your reply is spot on. I am working with the client on this. This issue only occurs on Monday morning and not all the time. I am beginning to wonder if IT has some setting whereby the server goes to somewhat sleep like state and the timing out is causing this.

  • Tim Wappat Profile Picture
    5,703 on at
    RE: Checking for lock records in SOP100 and SOP10200

    I would check that they are not re-building SQL indexes on a weekend with a SQL job, and that process is then overrunning into Monday morning!

    I think it is much more likely to be database contention from something like a maint SQL job, or Monday morning reports running and loading the database, on schedules from reporting services etc, than users loading it.

    Ask someone to check the SQL activity of the SQL jobs first thing Monday morning, bet you there is some maintenance type thingy running that they are unaware of. Get them to check the general server performance, graphing it through the morning too (memory, disk activity, etc).

    Also worth checking they are not doing something like shrinking the database or other maint on a weekend that could give performance issues as it tries to re-size and grow the DB, first thing in the morning....

    Those are my instinct thoughts.

    Tim

  • Richard Wheeler Profile Picture
    75,848 Moderator on at
    RE: Checking for lock records in SOP100 and SOP10200

    This mystery grows day by day. I caught it in the act this morning. So I had everyone exit GP and the task was still stuck. I then manually ran the executable and it finished in less than a minute. It appears to be something with task manager. My only thought right now was to delete the task and recreate and reschedule it. Let's see what happens the rest of this week.

  • Richard Wheeler Profile Picture
    75,848 Moderator on at
    RE: Checking for lock records in SOP100 and SOP10200

    I think what is happening is someone is sitting on an order in the import file. What this import does is it takes order information and updates the qty back ordered and qty to invoice on an order. The order already exists in GP so it is entirely possible someone could be sitting on an order. I will create a scheduled task that will keep checking my import table until all orders are imported for the day.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,047

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 885 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 592 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans