We need to run specific codeunit (OnRun trigger) and stop session afterwards from Windows Task scheduler. Our issues:
- for logged user client shows message to confirm connection (-consolemode parameter doesn't help)
- for not logged user codeunit isn't invoked. Event viewer reports unspecified error - probably concerning confirm connection message
- STOPSESSION command in our codeunit stop session, but shows unwanted message
Our codeunit doesn't need user interaction and interafce.
We need run this codeunit independently to other running NAV services. We use MS Dynamics NAV 2017 environment.
Any suggestion will help.
Thanks in advance
0
Answers
What do you mean by "logged" user? The user must be registeres as a NAV user and must have permission within NAV to access, whatever your codeunit accesses. This is true regardless of how you try to run the codeunit.
Task Scheduler can be configured to invoke task not depending to user is logged on machine.
I don't know if it is possible (and advisible) to supply full credentitials on the command line in order to use e.g. the user + password authentication scheme. I guess, the only option you have then is a call to a Web Service.