Auto startup Navision & Run Codeunit
rocopsa
Member Posts: 38
Dear experts,
I am doing some data exchange addon with other system and this got to be executed in mid-night.
Since existing coding in Navision is necessary, I have to use codeunit inside Navision.
I am now using Windows Task Schedule to execute finsql.exe and using Codeunit #1 to automate the job. All runs fine as if I am logging in. BUT.... when finsql.exe is executed when Windows is NOT logging in, it seems Codeunit #1 is not being run and so, my codes are also not started.
Inside Task Schedule, I have added all the startup parameters like ntauthenatication, server, database, company. Yet, still in vain..... ](*,)
So, do you have any good idea on that? The key is, I have to use codeunit in Navision to finish my job.
Thanks in advance! [-o<
Rocopsa
I am doing some data exchange addon with other system and this got to be executed in mid-night.
Since existing coding in Navision is necessary, I have to use codeunit inside Navision.
I am now using Windows Task Schedule to execute finsql.exe and using Codeunit #1 to automate the job. All runs fine as if I am logging in. BUT.... when finsql.exe is executed when Windows is NOT logging in, it seems Codeunit #1 is not being run and so, my codes are also not started.
Inside Task Schedule, I have added all the startup parameters like ntauthenatication, server, database, company. Yet, still in vain..... ](*,)
So, do you have any good idea on that? The key is, I have to use codeunit in Navision to finish my job.
Thanks in advance! [-o<
Rocopsa
0
Answers
-
Use the NAV Application Server, together with the Job Queue module, to schedule the execution of your codenit. The NAS runs as a Windows sevice and can be described as a NAV client without a user interface.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
Dear Luc Van Dyck,
Thanks very much! But, I am too fresh on NAS server and JobQueue, I failed to do so.
The NAS server is succesfully "Started" by NASMSnapIn.msc and JobQueue card has been made, yet, it seems the Job is not executed at the assigned time (Earliest Start Datetime)..... ](*,)
I have tried to look into many many posts there, but, cannot find the answer.....
Do you have any idea on this?
Thanks very much in advance!
Rocopsa0 -
Oh! Finally, I correct the Startup parameter in NASMSnapIn into JOBQUEUE and those JobQ has been executed. Yet...... encounter error as "...It has no parameter".
So, I will look for posts again for the solution. But, if you have any hints, please could you advise?
Thanks in advance!
Rocopsa0 -
The codeunit that is going to be executed through the JobQueue needs to have a parameter. That parameter needs to be a "Job Queue Entry" record. See for example codeunit 5917 or 5918.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
Thank you very much Luc Van Dyck.
Since I am running out of time, I use Report in JOBQUEUE instead and inside the report, CODEUNIT.RUN(mycodeunit) to execute my codeunit.
Nevertheless, the JOBQUEUE sucessfully executed BUT...., my codeunit is not being run. Neither my machine is logged on or not.
So, I would like to ask is there any restriction inside the codeunit in JOBQUEUE? My codeunit is to export the whole Item master as a txt file to a specific path. It runs fine when I press the [RUN] button manually, txt files are created in the path. But NOT in JOBQUEUE.....
Please kindly advise! [-o<
Thanks very much!
Rocopsa0 -
Is your report executed through NAS? Add some MESSAGE-statements in your report and codeunit, and look into the event viewer if you can see these messages. That way, you can pinpoint the problem.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
Thanks again Luc Van Dyck.
I got the reason.
It is because my codeunit contains Dataport. Eventhough I have given all the parameters (file path, sheet, etc) in the codeunit and then execute the dataport (that's why I only press the Run button and then the file will be exported), it is not being done by JOBQUEUE and NAS.
Then, I try to skip using dataport and export the data using OUTSTREAM, the same Jobqueue successfully exported out the txt file.
So, I feel dataport is not supported in Jobqueue eventhough all the necessary parameters are passed to it. Do you feel it is the fact? #-o
Thanks in advance!
Rocopsa0 -
It's all in the docs: see http://msdn.microsoft.com/en-us/library/dd355014.aspxrocopsa wrote:So, I feel dataport is not supported in Jobqueue eventhough all the necessary parameters are passed to it. Do you feel it is the fact? #-oThe following functions are not available in Microsoft Dynamics NAV Application Server:
Form Data Type functions
Dataport Data Type functionsNo support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Dear Luc Van Dyck,
Thanks very much!!! Finally I can have the right way to go!!!
So, I will change all the codeunits avoiding dataport.
Thanks very much again!
Rocopsa0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
