Temporary Table in Form

Frodio
Member Posts: 10
If i make a temporary table out of the table Sales Line (Temporary Property=Yes), And insert some records in it.
Then how can i open the sales line form with these temporary records?
And also do some changes on them without Attain saving the records back to the "real database"?
I have looked for a property in the form that says like "use as temporary" or somthing. Anybody got a idea? :roll:
Then how can i open the sales line form with these temporary records?
And also do some changes on them without Attain saving the records back to the "real database"?
I have looked for a property in the form that says like "use as temporary" or somthing. Anybody got a idea? :roll:
0
Comments
-
sorry this doesn't work ... i tried it too some time ago0
-
Sure it can be done!!!!
Anything is possible.... Either it's the correct or incorrect way to solve things...
Take a good look to form 6510, Item Tracking Lines, in Navision attain and higher. This form is based on a temp. table. Not exactly the sample you would like to have it, but hell...
How does it work? Well it's quite simple actaully... In theory! You will need to code the OnFindRecord and the OnNextRecord on the form.
BUT!!!!! Be carefull... Any changes made to other objects in Navision from the temp. object will be in the "REAL" database.
Sample: If I would validate a field in a temp. table and in OnValidate of this field programmed that a is created in the mutationlog (or any table) this record will not be in the temp. version of that record. It will be in the real database!"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
Maybe check the following links as well?
http://www.mibuso.com/forum/viewtopic.php?t=1485&highlight=temp
http://www.mibuso.com/forum/viewtopic.php?t=1457&highlight=temp
http://www.mibuso.com/forum/viewtopic.php?t=404&highlight=temp"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
You probably know this, but you make a record variable temporary when you declare the record variable in C/AL Globals or Locals. It's a property of the variable. I've had some problems w/ temporary tables because of some stupid mistakes I've made. :?
1. A temporary table is reinitialized to null when it loses scope, which is a good reason NOT to make a temporary table local unless you are passing it as a referenced argument.
2. A temporary table does not keep it's value among different instance variables for the table. In other words, if a form calls functions in your table, and those functions invoke other form(s), and those forms use a record variable (other than one you pass by referenced argument, there is no association between the two distinct instances. Your record will be null.
3. I've also had problems reinitializing a temporary record, specifying different filters, and building a new recordset. It doesn't work. The FIND or GET calls always return FALSE. Maybe it was something I was doing wrong.
Hope this helps.0 -
Thanks for alle the replays \:D/
I disovered as you said .. it would be a monster code. So i did some work around and made some helping fields in the originale table.
Soon done and hope it work just the way i want it to! (It's allowed to dream is it not?) :whistle:0 -
That's what I ended up doing! :shock: I declared a boolean field called Temp. When I'm done with all of the processing, I deleted the fields where Temp is flagged.0
-
Guys!
At least use a copy of the table, or am I saying something really bad here?
BTW, Ever made an array of temorary tables? It;s real fun and could be very usefull if only it worked. But there is a major bug in it somewhere... Don't know what bug anymore tho"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."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