You cannot make any changes in the database until a tran...
Slawek_Guzek
Member Posts: 1,690
Hi all,
Some of you probably saw the error:
Is this a bug ? or is there any official MS document saying: yes - this behaviour is by design. If it is a bug does anyone report this to MS ?
Regards,
Slawek
Some of you probably saw the error:
This error apperas when you try to insert anything into database in OnInit trigger, or OnURL trigger on the form.You cannot make any changes in the database until a transaction has been started.
Is this a bug ? or is there any official MS document saying: yes - this behaviour is by design. If it is a bug does anyone report this to MS ?
Regards,
Slawek
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
0
Comments
-
And also in the OnAfterGetRecord-trigger. This is normal behaviour. I don't know where it is written, but if I would want to see it, I would start looking in w1w1adg.pdf.Slawek Guzek wrote:Hi all,
Some of you probably saw the error:
This error apperas when you try to insert anything into database in OnInit trigger, or OnURL trigger on the form.You cannot make any changes in the database until a transaction has been started.
Is this a bug ? or is there any official MS document saying: yes - this behaviour is by design. If it is a bug does anyone report this to MS ?
Regards,
SlawekRegards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
And also in the OnAfterGetRecord-trigger. This is normal behaviour. I don't know where it is written, but if I would want to see it, I would start looking in w1w1adg.pdf.
I was so smart to look there, but not smart enough to find anything regarding inserting new data in OnInit or OnAfterGetRecord.
I was smart enough to find on p.277 w1w1adg.pdf an example of C/AL code showing usage of MODIFY in OnAfterGetRecord, which actually doesn't work
.
I'm wondering if it is an error because NAV throws an error even if one tries to insert/modify the data in the table completely unrelated to the form.Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
No it isn't. That trigger is ONLY for getting (=reading) some info from the DB to be shown on the form. It has no sense writing data in that moment. Also because you would create a LOT of writes to the DB creating performance problems.Slawek Guzek wrote:I'm wondering if it is an error because NAV throws an error even if one tries to insert/modify the data in the table completely unrelated to the form.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
kriki wrote:
No it isn't. That trigger is ONLY for getting (=reading) some info from the DB to be shown on the form. It has no sense writing data in that moment. Also because you would create a LOT of writes to the DB creating performance problems.Slawek Guzek wrote:I'm wondering if it is an error because NAV throws an error even if one tries to insert/modify the data in the table completely unrelated to the form.
That's true in case of OnAferGetRecord. But what about OnInit and OnURL ? And why w1w1adg.pdf says that MODIFY is possibble in OnAferGetRecord :-kSlawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Slawek Guzek wrote:yes - this behaviour is by design.
What you need is a very very slow connection to the NAV server.
Try connectiing direct over a slow interent connection.
Then open a form with complex captioning. It then becomes clear what it is drawing it what sequence (or use the dubegger but uuurrrggghhh).
Of course it would sometimes be nice to be able to cption a field once you have the record, but I think in balance it would just add too much performance over head to have that ability for the one in 100,000 times that its needed.David Singleton0 -
:?: :shock: :?: :shock: :?: :shock:
:-k
David, could you please be more specific ? I can't figure out to what your answer is related to...Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Slawek Guzek wrote:David, could you please be more specific ? I can't figure out to what your answer is related to...
My first laptop that I used for many of my Navision impelmentations was a 486 16mhz with 12 meg of ram.
Because it was quite slow, making things go fast were very important to me. (It probably is patially why now I am so good at making NAV systems go fast).
have that computer I saw many things that you never see on a fast computer, and one of them is how Forms are drawn in Navision. So i you have a slow connection to the server you can emulate this slow speed,a nd you can see what is happening when a form opens in slow motion, and see what takes the most time etc.
This can help you understand why they do it this way. using the debugger is not the same because one key stroke of F8 or f5 could be 1 milli second or 1 second you dont know.David Singleton0 -
in a report you can use the follow trick :
Report - OnInitCLEARALL; codsite := cunPLATOUserSite.fct_Return_DefaultSite; recPLATOSetup.GET(''); IF recPLATOSetup."Invoice file number" = '' THEN ERROR(textFileNumber); txtFile := INCSTR(recPLATOSetup."Invoice file number");
Report - OnPrerecPLATOSetup."Invoice file number" :=txtFile; recPLATOSetup.MODIFY; COMMIT;
0 -
Now you don't have to.Mister B wrote:in a report you can use the follow trick :
Microsoft has finally solved that problem in hotfix 954722 posted in April 2009.
Exe build number is 5.0.27253.0
Regards,
SlawekSlawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030
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
