You don;t want to use TESTFIELD because when that fails you get an error message and the transaction is aborted. What you want to do is control every contingency in code. So instead of doing TESTFIELD(SomeField,SomeValue) you do:
If SomeField = SomeValue THEN BEGIN
// do something here
END ELSE BEGIN
// do something else here
END;
That's the only way to prevent the event logfrom filling up with errors that you would normally see as a user. NAS is a client session without a human being looking at the screen, so you have to program it to act like one. Use your common sense to determine what you can and cannot do.
There's nobody looking at the screen, so why would you want to display anything? The only reason you ever should use a form object is when you need to display something. NAS doesn't have a user looking at the screen, so you never ever need to use a form when working with NAS.
Don't forget about the GUIALLOWED function, which is useful for setting up seperate behaviors for the Nav client and NAS. Although there would be no need to use this function in the CU that is running under NAS, it can be a useful function if you are VALIDATEing fields.
I'm also not sure if you can run a dataport which imports a file from NAS. I had a dataport variable setup with all properties (filepath, import/export direction) and NAS showed error that "you can't use dataport....". That was in navi 3.7. Maybe in v4 its possible.
I'm also not sure if you can run a dataport which imports a file from NAS. I had a dataport variable setup with all properties (filepath, import/export direction) and NAS showed error that "you can't use dataport....". That was in navi 3.7. Maybe in v4 its possible.
No it's still not possible in v4.
Ahmed Rashed Amini
Independent Consultant/Developer
I try to start a dataport by the NAS and the NAS displays: "You cannot use C/AL variables of type DATAPORT when running the Microsoft Business Solutions-Navision Application Server."
In the dataport I set the properties (in brackets the value): Filename (path to my local computer), Import (No), UseReqForm (No), ShowStatus (No).
I tried to start the dataport with Dataport-var and directly with DATAPORT.RUN(50000)
I always get the same error.
By the way: I use the sql-server, maybe it makes a difference.
Just my 2 cents regarding testfield etc.
If you use the navision timer dll, you could just run your codeunit and in the trigger timer::onTimerError you could handle some errors or write a log
Hi all,
I think you have no problem in using ERROR, TESTFIELD or also MESSAGE in NAS, because simply in that case the messages are all written in the NAS log because they don't need a user decision but they are only messages to the user.
I think the instructions that must be catched with GUIALLOWED are those ones that want a user decision so: CONFIRM, STRMENU. There are also the Dialog variables that must be controlled with GUIALLOWED.
Marco
Marco Ferrari Microsoft Certified Trainer Cronus.it
Comments
Example:
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
when i use the variable of type its throwing the error in event viewer
that
You can not use C/AL variables of type Form with NAS
No, it is not possible to use FORM under NAS... [-X
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
There's nobody looking at the screen, so why would you want to display anything? The only reason you ever should use a form object is when you need to display something. NAS doesn't have a user looking at the screen, so you never ever need to use a form when working with NAS.
RIS Plus, LLC
No it's still not possible in v4.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
You need to disable request form on the dataport to be able to use it under NAS...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
In the dataport I set the properties (in brackets the value): Filename (path to my local computer), Import (No), UseReqForm (No), ShowStatus (No).
I tried to start the dataport with Dataport-var and directly with DATAPORT.RUN(50000)
I always get the same error.
By the way: I use the sql-server, maybe it makes a difference.
Any ideas?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
RIS Plus, LLC
This is what I've been doing for integrations and using NAS.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
If you use the navision timer dll, you could just run your codeunit and in the trigger timer::onTimerError you could handle some errors or write a log
I think you have no problem in using ERROR, TESTFIELD or also MESSAGE in NAS, because simply in that case the messages are all written in the NAS log because they don't need a user decision but they are only messages to the user.
I think the instructions that must be catched with GUIALLOWED are those ones that want a user decision so: CONFIRM, STRMENU. There are also the Dialog variables that must be controlled with GUIALLOWED.
Marco
Microsoft Certified Trainer
Cronus.it