How to update a temporary table used in a form?

hazem
Member Posts: 187
Hello everybody,
i have a form in which i use a temporary table. The first time the user push a button in the form, some records are inserted into this temporary table. When he push the button again i puted a function to delete all the records previously inserted to insert the new one; They are deleted but still got a message telling me that the record already exist when the insert process begin. I think it's an update problem but how to solve it?How to update a temporary table? :-k
i have a form in which i use a temporary table. The first time the user push a button in the form, some records are inserted into this temporary table. When he push the button again i puted a function to delete all the records previously inserted to insert the new one; They are deleted but still got a message telling me that the record already exist when the insert process begin. I think it's an update problem but how to solve it?How to update a temporary table? :-k
0
Answers
-
You could Try
TempRec.DELETEALL;
SELECTLATESTVERSION;
TempRec.RESET;
TempRec.INIT;
If that don't work then
IF NOT TempRec.INSERT THEN
TempRec.MODIFY;
Running a form on a temporary table, you might also try using two temporary tables, so you are not deleting the displayed records, only replacing them.
Run your Code on TempRec2 then
TempRec := TempRec2;
CURRFORM.UPDATE(FALSE);Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
I tried this:
TempRec := TempRec2;
CURRFORM.UPDATE(FALSE);
but that doesn't work!!!! :? What should i do?0 -
before deleting make sure you do a reset.
TempRec.reset;
TempRec.DELETEALL;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