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
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.
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.
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
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
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 this
MyCu.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)
Answers
If you you want to catch an error thrown from the code then there are a few ways to do that.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Thanks in Advance...
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
thanks in advance
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
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Thanks in advance
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 this
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)
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03