Handling of C/AL Error statement

sbranin
Member Posts: 18
I am seeing situations in NAV 2015 where the ERROR statement stops processing but does not display the text of the error. I have searched the forums and haven't found any information on this. I did find this mention in the release notes for NAV 2015 Cumulative Update 3:
362556 The ERROR C/AL statement does not execute as expected in some scenarios.
However, I am also seeing the problem in a system with CU4 installed. Is there a way to structure code, such that the text of the ERROR message should not get displayed?
Thanks for any input. Searching for this problem has proved difficult as a very high number of posts include the word "error".
-Steve
362556 The ERROR C/AL statement does not execute as expected in some scenarios.
However, I am also seeing the problem in a system with CU4 installed. Is there a way to structure code, such that the text of the ERROR message should not get displayed?
Thanks for any input. Searching for this problem has proved difficult as a very high number of posts include the word "error".
-Steve
0
Answers
-
I figured this out.
First, you can suppress the display of ERROR message by calling a Codeunit using the syntax like thisIF mycodeunit.RUN THEN
Any ERROR messages further up the call stack will not get displayed, they will just cause this IF to fail.
The difference I was seeing in NAV 2015 vs. NAV 2009 R2 was caused because Microsoft fixed a bug in NAV 2009 where the setting in Warehouse Setup.Receipt Posting Policy did the same thing regardless of which option you choose. By fixing this errors that had not been suppressed in NAV 2009, are now getting suppressed in NAV 2015.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