Regarding display a list of error in a page in NAV 2009

bharathnan
Member Posts: 92
I want list the error which all we are getting when we try to run a report or forms in page using RTC in nav 2009,...
Can anyone help me with this..
Thanks in advance
Can anyone help me with this..
Thanks in advance
1
Answers
-
Not sure what you exactly want to achieve.. If you want to have a complete list of actual errors which could be potentially thrown from a code then, no, can't do.
If you you want to catch an error thrown from the code then there are a few ways to do that.Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Actually when transferring data from a table to another table which has same field name with different data types ,it throws some error which field has different data type but the values of other data types are not transffered ........Here I want the data of the remaining fields also to be transfered and also the error must be captured and must be displayed in a page.
Thanks in Advance...0 -
You can make a very simple function just meant to transfer the data between records, and mark it as a TryFunction
TryFunction TansferData(FromRecord, Var ToRecord) BEGIN ToRecord.TRANSFERFIELDS(FromRecord) END
Then use it in yor codeIF NOT TansferData(FromRecord, ToRecord) THEN //handle the error here
SlawekSlawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
ok thanks for the answer i will check on that0
-
Sorry to say that i am a beginner and what you have answered me is too far to understand ,can you explain it elaborately ..
thanks in advance0 -
1. Edit an object
2. Create a new TansferData function in it
3. Click Properties (or press Shift+F4) while your function is highlighted in C/AL Globals window
4. Change TryFunction Propery to Yes
Then add parameters, make sure the parameter where you will be passing your output table is marked as Var
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
I searched for the tryfuction property in NAV but it is not present there ...and i am currently using nav 2009 or 5.0 version can you suggest answers regarding to my version
Thanks in advance0 -
If you have NAV 2009 why have you posted in NAV Three Tier forum then?
Anyway, you will need a separate codeunit for that.
Make two global variables in the codeunit, one of type FromRecord, another of type ToRecord, make two functions in in SetFromRecord which will set the global FromRecord to whatever is passed in the call, make function GetToRecord, which wll return global ToRecord, in OnRun trigger put put your GlobalToRecord.TRANSFERFIELDS(GlolbalFromRecord)
In your code where errors needs to be detected create variable of type of the codeunit, when you need to transfer the data cal thisMyCu.SetFromRecord(MyFromRecord) IF MyCu.RUN THEN MYCu.GetToRecord(MyToRecord) ELSE //handle the error here
Having said that I'd rather suggest to redesing your records to make field numbers, types and lenghts matching each other in both tables, so the TRANSFERFIELDS can work without errors, or create your own MyTransferfieldsFrom() function on ToRecord, include as series of simple assignments in it, and instead of using TRANSFERFIELDS call ToRecord.MyTransferfieldsFrom(FromRecord)
Slawek 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.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