is the runtime of global variables always the entire session?

kenyo
Member Posts: 40
EDIT: So i have debugged a little bit and even though i have declared the variables globally , as soon as i leave the codeunit by calling another codeunit and try to use the getfunction , everything is unitialised
according to this post https://forum.mibuso.com/discussion/73254/can-you-access-another-codeunits-variables-during-runtime-via-a-get-function global variables should be stored during RUNTIME anyway so how is it possible that the instance is wiped when i call a getfunction right after leaving it ( i have done this before also )
according to this post https://forum.mibuso.com/discussion/73254/can-you-access-another-codeunits-variables-during-runtime-via-a-get-function global variables should be stored during RUNTIME anyway so how is it possible that the instance is wiped when i call a getfunction right after leaving it ( i have done this before also )
0
Answers
-
If you run the codeunit, and get the variables through your function, the codeunit should be the same handle as it was initially run. If not, you could set the CU property single instance. In that case global variables will be stored during runtime, and after. You can get the content with a different handle.0
-
If you run the codeunit, and get the variables through your function, the codeunit should be the same handle as it was initially run. If not, you could set the CU property single instance. In that case global variables will be stored during runtime, and after. You can get the content with a different handle.
yea I already tried the single instance property and it's working but i don't know if it would interfere with other functions of that ( enormous ) CU.
And yes the CU is run ( 51119 in the picture ) but when i call the getfunction from the table 5077 it's a new empty instance , and i can't figure out why.
thanks for the reply.0 -
If you run the cu in t5077 and use getfunction in t5077 during the same run of t5077, with the same cu var, that is a global var.. after cu run, it ought to work.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