NAV Gurus,
I've looked at entire forum but cannot find an answer to my specific problem, which is the following:
I've created a codeunit that will post ship sales orders using the Navision Application Server, I have modified CU80 (Sales-Post) to supress all instances of any dialog windows from opening or updating (was getting error 'You cannot use C/AL variables of type DIALOG when running the Application Server for Microsoft Dynamics NAV Classic.'), after the modifiction, I am now getting error 'You cannot use C/AL variables of type FORM when running the Application Server for Microsoft Dynamics NAV Classic.'.
I've looked at the entire codeunit 80 and all local functions and I cannot find any variables of type FORM, furthermore, I've remmed out all instances of all dialog windows that I can find, when I run this same routine on the foreground on my workstation, it posts the sales order successfully with absolutely no windows or forms popping up, can anyone give me a hint as to why I'm getting this error when running on the NAS?
0
Comments
:-k actually, i am not using the VERY STANDARD tracking module, but a modifed one...i'm wondering where did we do different... :-k
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
IF GUIALLOWED THEN
ERROR(Text000);
So I guess I should simulate the behavior of the ERROR function but not show a dialog box. How do I achieve that?
IF GUIALLOWED THEN
MESSAGE(Text000)
ELSE
// <what to do here?>
You need to condition the "confirm" instructions and dialog type variables.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Do You want to replace ERROR to MESSAGE? But's that big mistake... you can post broken data.
IF GUIALLOWED THEN
ERROR(Text000);
ELSE
BEGIN
SendToLogTable(Text000); //Your function, if you want to write error to some Log file
EXIT; //it's not right to continue
END;
Your code will exit and commit. There must be error to roll-back! If you want to log something - do something like
- ERROR aborts the execution of the process and rolls back to the last commit
- EXIT exits the current function and the execution proceeds!!!!
if you want to do a "try-catch" like process, you have to wrap your errors in an IF codeunit.run then (search GETLASTERRORTEXT in this forum..you should find useful threads)
EDIT: ppavuk was faster, but i wrote my post with all my love and i didn't want to waste it
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
By to add another 2cents - messages and errors aren't problem for NAS. The dialogs and forms - are.
As far as I know messages will be just omitted, but errors will be logged to windows application log.
I figured this is on topic so I'll post here.
I've gotten rid of all the message issues and am probably facing another one.
Recently the users are complaining that they get an error message when they are trying to post.
Something like "The ... cannot be changed because it is locked by another user".
So trying to isolate the cause I turned off the NAS and the problem went away.
So I believe my little NAS posting routine is locking the users out from doing their own posting.
Have any of you dealt with that issue before? Any suggestions?
Thanks