NAS SingleInstance behaviour when called from a page

MiguelCosta
Member Posts: 4
Hi All
I've got a codeunit 50001 that is started with NAS and JOBQUEUE.
This codeunit has functions to init a variable 'Start' to TRUE or FALSE and it messages to event viewer in windows that variable:
OnRun()
DoIt;
DoIt()
MESSAGE('DoIt %1',Start);
StartON()
Start:=TRUE;
MESSAGE('Started:%1',Start);
StopOff()
Start:=FALSE;
MESSAGE('Stopped:%1',Start);
setBool(Bool : Boolean)
Start:=Bool;
getBool() : Boolean
EXIT(Start);
Then I've got a PAGE that has a button to call the StartON() function to init the 'Start' to TRUE.
If I go to the PAGE an hit the button to call the StartON() function imodifies the 'Start' to TRUE.
If I open other page similar to this one that has call for the function getBool() it says 'YES', so the single instance codeunit is working between pages. The 'Start' is set to 'YES' because I set it TRUE on first PAGE.
But in the EventViewer triggered by NAS I can see every minute events with the 'DoIt NO'.
Resuming: The singleInstace codeunit works fine but for some reason NAS seems to catch other instance of the same codeunit.
Can someone hep me?
Thanks
Miguel Costa
I've got a codeunit 50001 that is started with NAS and JOBQUEUE.
This codeunit has functions to init a variable 'Start' to TRUE or FALSE and it messages to event viewer in windows that variable:
OnRun()
DoIt;
DoIt()
MESSAGE('DoIt %1',Start);
StartON()
Start:=TRUE;
MESSAGE('Started:%1',Start);
StopOff()
Start:=FALSE;
MESSAGE('Stopped:%1',Start);
setBool(Bool : Boolean)
Start:=Bool;
getBool() : Boolean
EXIT(Start);
Then I've got a PAGE that has a button to call the StartON() function to init the 'Start' to TRUE.
If I go to the PAGE an hit the button to call the StartON() function imodifies the 'Start' to TRUE.
If I open other page similar to this one that has call for the function getBool() it says 'YES', so the single instance codeunit is working between pages. The 'Start' is set to 'YES' because I set it TRUE on first PAGE.
But in the EventViewer triggered by NAS I can see every minute events with the 'DoIt NO'.
Resuming: The singleInstace codeunit works fine but for some reason NAS seems to catch other instance of the same codeunit.
Can someone hep me?
Thanks
Miguel Costa
0
Comments
-
The single instance codeunits are per user session, i.e. two different users will not see each other's single instance codeunits. And the NAS is a separate user instance and can hence not see the other sessions' single instance codeunits.
In order to obtain what you want here, you will need a database table to store the global values.Bardur Knudsen
Microsoft - Dynamics NAV0 -
Thanks Bardur Knudsen.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
- 320 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