Problem with a Temporary Table

sabzam
Member Posts: 1,149
Hi, I am accessing a table and insert a copy of the extracted record into a temporary table. What is quite strange is that I excess again the same table but under a different name and post a copy of the record into the same temporary table and for some reason the temporary table is being cleared from all the records.
Has anyone got any idea why this may be happening?
Has anyone got any idea why this may be happening?
0
Comments
-
Can you elaborate on this?0
-
every variable of a temporary instance of a table has it's own instance and memory. They do not share records.
If you do want to share the records. You you can make it an array of a temporary record variable.
That way If you insert in MyRecord[1]. MyRecord[2] will read it.0 -
I believe (could be that i'm reading it wrong) that there is just one temp table being used. And inserting records from table B into this temp table will make the previously inserted records of table A dissappear from the temp table.
Not quite sure if this is the case though, would help if some code is posted.0 -
Hi,
the case is exactly as has been described by M. Eleveld . The only coding being used is
BankLedgerEntry.Copy(BankAccount1);
BankLedgerEntry.Insert;
BankLedgerEntry.Copy(BankAccount2);
BankLedgerEntry.Insert;
The first part for table while the second for table b. BankLedgerEntry is a temporary table. I simply can't understand which the entries are automatically being deleted as soon as I insert the first line in table B. Could it be that there is a propery or something which I don't know about it?0 -
BankLedgerEntry.RESET should do the trick.0
-
Why wont use the TRANSFERFIELDS command.
LikeTempRec.DELETEALL; TempRec.INIT; TempRec.TRANSFERFIELDS(Rec); TempRec.INSERT;
Navision noob....0 -
One problem with temporary records that I've seen is that the debugger does not cope with them very well. So the record may have been inserted into the table but you don't see it when you zoom in using the debugger. I'm assuming that BankAccount1 & 2 can be copied to BLE records.
BankLedgerEntry.Copy(BankAccount1); BankLedgerEntry.Insert; BankLedgerEntry.Copy(BankAccount2); BankLedgerEntry.Insert; BankLedgerEntry.Reset; If not confirm('BLE Record Count: %1',true,BankLedgerEntry.count) then error('');
Try something like this to see or use a form to display ALL of the records in the set.0 -
this piece of code does not work as you expected.sabzam wrote:BankLedgerEntry.Copy(BankAccount1);
BankLedgerEntry.Insert;
insted of copy, use direct assignment of records.banaccount1.find('-'); repeat BankLedgerEntry := BankAccount1; BankLedgerEntry.INSERT; until bankaccount1.next=0
try this.0 -
Yes, the copy function is mainly used when you need to coppy the sorting order and filters. Not values. The assigning the record is better way how to transfer just values from one record to another (when tables are same).0
-
Hi Thanks alot for your support. The ':=' has worked perfectly. Apparently the filters where in some way distracting the temporary Table.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