Possible to pass Temp Table between two objects?

Xypher
Member Posts: 297
If possible, by what method would I have to go about to "share" a temporary table between two objects?
0
Comments
-
You have a couple of options.
One is to use a single instance codeunit. Your temporary variable is stored and manipulated there. This can be difficult to manage; it is only really an option when you have a large amount of data stored in your temp table that you want to pass around.
The other option is to use a "copy constructor" when you pass a temp table by reference between objects, you don't get access to to the records stored in the temp table in the called object. Therefore you need to create a local temp variable, and copy records into/out of it, for use where you need.
In general, this is the better approach.
Finally, you can try using a real table. You will need to add session id as part of the primary key.0 -
And best way is to pass the record variable by reference (as parameter for some function using VAR for the parameter). Than you can do what you want in the function and when the function finished, you have the modifications in your calling object too... but all depends on what you want to do... 8)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