Validation in a report

Sapphire123
Member Posts: 112
Hi All,
In my processing report, I would like to capture errors when I'm validating field, e.g. recSalesHeader.validate("Sell-to-customer", theCustName)... if 'theCustName'does not exist, I would like to capture the error message, instead of having a pop up message displayed to hte user - how do I do this?
Any suggestions?
Thanks in advance!
In my processing report, I would like to capture errors when I'm validating field, e.g. recSalesHeader.validate("Sell-to-customer", theCustName)... if 'theCustName'does not exist, I would like to capture the error message, instead of having a pop up message displayed to hte user - how do I do this?
Any suggestions?
Thanks in advance!
0
Comments
-
---FAIL! Deleted because I misread the question---"OMG ALL MY DATA IS GONE"
"Show All..."
"Oh..."0 -
The only thing you could do is to test for the error situations first and report on those, but that would take a LOT of programming.0
-
---FAIL! Deleted because I misread the question---"OMG ALL MY DATA IS GONE"
"Show All..."
"Oh..."0 -
Hi there,
You could probably do something like this:
1) create a function called IfItemExists(ItemNo)
If Item.Get(ItemNo) then exit(true)
else exit(false)
2) If IfItemExists(ItemNo) then
recSalesHeader.validate("Sell-to-customer", theCustName) else
...//record the missing item somewhere in a text file or another table
Regards,0 -
If you are runnning NAV5 you can use GETLASTERRORTEXT
Have a codeunit call the report. If the codeunit returns true, the report is ok, if it returns false you can catch errorstring.Don't just take my word for it, test it yourself0
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