ERROR Behavior Guess what happens
mik
Member Posts: 79
Hi,
I have a little example code. Maybe many of you know this but for me it was quite new.
Cust (Record Customer)
Vend (Record Vendor)
Compare 5.XX or lower with 6.01 R2 Build 32XXX
Even if you try to compile you will notice that there is a difference between 5.xx and 6.01 R2 (or maybe also lower)
The ERROR must occur after the second insert. Normaly the code stops here!? Not in 6.01 R2.
Can someone please verify this and tell me if this is an official behavior?
greetings
mik
I have a little example code. Maybe many of you know this but for me it was quite new.
Cust (Record Customer)
Vend (Record Vendor)
Cust.INIT;
Cust."No." := 10000;
Cust.INSERT;
Cust.INIT;
Cust."No." := 10000;
Cust.INSERT;
Message('Customer Insert worked great!\Well done!');
// or any other code without database transaction
Vend.INIT;
Vend."No." := 10000;
Vend.INSERT;
Compare 5.XX or lower with 6.01 R2 Build 32XXX
Even if you try to compile you will notice that there is a difference between 5.xx and 6.01 R2 (or maybe also lower)
The ERROR must occur after the second insert. Normaly the code stops here!? Not in 6.01 R2.
Can someone please verify this and tell me if this is an official behavior?
greetings
mik
With kind regards
mik
0
Answers
-
0
-
Hi,
thanks now its clear but changes a lot for developers.
http://msdn.microsoft.com/en-us/library/dd355341.aspx
Thanks Belias!
With kind regards
mik0 -
You're welcome.
anyway, i don't see so much difference for the developers except that you have to be "smart" when you debug (you have to forecast the behaviour of the bulk inserts).
It is a cool feature to give a boost to the insert performance, in some instances...0 -
Hi,
you are right. But sometimes it was quite comfortable to let NAV run into an error so you do not have to catch every single case.
I noticed this error because of database operations where after these operations files have been operated. This shocked me quite a lot. So it seems that my coding is quite ok because of the fact that I haven't noticed this befor. But my research is quite bad so I haven't seen this msdn article before ](*,)
Thanks again
With kind regards
mik0 -
Give the same code a try with the debugger. The error will come at the 2nd insert, because debugging disables the bulk-insert feature.
Also IF rec.INSERT THEN ... disables the bulk-insert
and also if you use the autoincrement=Yes in the table.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
No thats the point. The debugger will handle the complete code and after the last line he will show the error from the second insert. Only with
IF cust.Insert ....
or Commit or your autoincrement (never tried) the debugger will stop when the error occurs.
Thats way i said .. "good to know" :idea:
With kind regards
mik0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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