Running a existing batch job automatically....
ritz
Member Posts: 25
Hi All,
This question is bit country specific but in terms of technique it goes like this:
We have a batch job(Daily Stock Account Generator) which we need to run for every single day(when you run this report it ask for the date you want to run this batch job for). And as you all know clients do not want to do that they want it to be automatic.
I was thinking of giving the date range but got stuck as there are some complexities with it.
I have not tried it with the job scheduler,
any ideas??
Thanks and Regards,
Ritesh
This question is bit country specific but in terms of technique it goes like this:
We have a batch job(Daily Stock Account Generator) which we need to run for every single day(when you run this report it ask for the date you want to run this batch job for). And as you all know clients do not want to do that they want it to be automatic.
I was thinking of giving the date range but got stuck as there are some complexities with it.
I have not tried it with the job scheduler,
any ideas??
Thanks and Regards,
Ritesh
Thanks,
Ritesh
Ritesh
0
Comments
-
Is this a Report or Dataport?
OnPreReport you can populate the Date Filter like this
OnPreReport()
Customer.SETRANGE("Date Filter",0D,WORKDATE);
or
MyDate := WORKDATE;Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
Hi David,
There is a problem with this report. This report is bit stiff in terms of Date filtering.
This batch job takes only one date and evaluates the stock on that particular date.
for example.
i run this report on say 10th of Dec and again i run it on the 15th of Dec, it will only tell me the status of the 10th and the 15th of dec not for the 12,13 or 14. (Hope i am able to explain what i want to.).
ThanksThanks,
Ritesh0 -
The report returns the Quantity at date, this means the sum of all entries from 0D to the Entered Date.
You could show the "Net Change" for a Date period, but that only shows the movement postings within the period.
What do you really want to show?Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
Dear Friend,
As I can guess this report is for Excise puprose. This report must be (as per my experience with this report) shows the days opening balance + receipt - issues = closing stock. The report only runs for the item on which excise is levied.
As per ur statement the report needs to be run automatically. :-k :-k
Normally the user when ever needs the report , runs it and prints its. Do you want to automate the process so that every morning the report is run and the print is available to the concerned person or are you storing the data of the report in some table or exporting it.
Please clarifyCA Sandeep Singla
http://ssdynamics.co.in0 -
Hi Ritesh
Lets try this -
Create a table Batch Execuation Status in the database with field - Date, Batch Execuation Status
Add the code in function LogInStart() in CU1 Application Management. The code should check the data in the Batch Execuation Status table for the status of the execuation for today and if there is no entry, it should execute the code to run the batch job.
Modify the Batch Job, If it runs successfully. It should add a line in Batch Execuation Status table.
Mukesh Verma
0 -
If you have the job scheduler licensed it would work perfect for this, I use it to run daily requisitions, ect.
I set the datefilter with code like explained above.
here is part of my code, I use slightly different dates then you,
Report - OnInitReport()
OrderDate := TODAY +20;
ToDate := TODAY +20;
CurrTemplateName := 'REQ';
CurrWorksheetName := 'SF';
Report - OnPreReport()
Counter := 0;
MaxDate:= 12319999D;
IF OrderDate = 0D THEN
ERROR(Text002);
IF ToDate = 0D THEN
ERROR(Text003);
PeriodLength := ToDate - OrderDate + 1;
IF PeriodLength <= 0 THEN
ERROR(Text004);
Anyways setting the date in the code is straight forward, the job schedulers runs the report every day at 10 pm, the branch manager come in the morning and have a stock requisition ready.0 -
Thank You Very much to all of you i got the answer
Thank you Mukesh Sir!Thanks,
Ritesh0
Categories
- All Categories
- 75 General
- 75 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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions