Open wgross92 opened 9 months ago
There are 2 points in the documentation Handling Errors using Try Methods:
So, probably, that is the reason of your issue (a combination of those points).
But this phenomenon is not described in the documentation:
myTryFunction( //THIS IS A TRY FUNCTION which receives a parameter myNormalFunction()); //THIS IS A NORMAL FUNCTION with a result. e.g.: a text
If the TryFunction is treated as a TryFunction, then in this case the Normal NOT TryFunction is also treated as a TryFunction.
It is not called by the try function, only the result is passed directly to a try function.
It is ok if that is how it should be, but it is not documented. There is also no corresponding error message. The error message says that function "x" is a try function, but if the developer looks in the code this is not the case. Perhaps it has not been common practice under AL/NAV to use resutls directly. But it will be used more and more as it gets closer to "normal" languages like C# :)
Describe the issue
Situation: The result of procedure A is entered directly as a parameter in procedure B. Procedure B is a TryFunction. Procedure A is not a TryFunction. Result of procedure B is handelt with 'if' or asign to a boolean. However, if A executes a DB operation, a server error occurs because A is a TryFunction. Only its return was taken as a parameter.
Steps to reproduce