How to check if codeunit is running by other user?
vh8000
Member Posts: 23
Hi All,
I've created a import codeunit that will import Sales Order from external source, it is running by Job Queue, but user has option to run it manually in case they need to.
My question is how to check if the import codeunit is running? (I want to exit the import if other user/job queue is already running).
Thanks
vh8000
I've created a import codeunit that will import Sales Order from external source, it is running by Job Queue, but user has option to run it manually in case they need to.
My question is how to check if the import codeunit is running? (I want to exit the import if other user/job queue is already running).
Thanks
vh8000
0
Best Answer
Answers
-
Something similar has been discussed here:
https://forum.mibuso.com/discussion/69824/code-gurus-only-single-page-instance#latestRegards
xStepa0 -
A single instance codeunit is global in regard to a single client, not a database or company or even a client computer or user (See SingleInstance Property on MSDN).
As you are probably accessing files anyway, I recommend you create a flag file. Alternatively you can set a "Flag" in the database. You should commit that change, before you start importing.
Either way, if the importing session terminates for some reason, the flag might get stuck. You need to decide if it is ok for this condition to be detected and corrected by human workers, or if you need to implement an additional watchdog.0 -
Thanks for all suggestions.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 322 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

