Hello,
I'm running 4 SP3 and need to use the job scheduler to run Report 795 Adjust Cost - Item Entries with today's date.
I've worked out the job scheduler setup (for the time of day to run), but was wondering...is there a way to 'run' the report as is, and enter/validate today's date on the job scheduler, OR
do I set up a processing only report with the same code as found in Report 795?
Thanks, Chris
0
Answers
2) You can add some funtionality to set the parameters of the report through parameters of the JobQueue
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
What I was thinking, is that I create a custom processing only report copied 100% from Report 795. I set Job Scheduler to run the report 1x daily at 10pm. The only part of the code that I'll change will be automatically setting the posting date to TODAY. Please check out the following:
//IF PostingDate = 0D THEN
// ERROR(Text004);
//SET POSTING DATE
PostingDate = TODAY;
ItemApplnEntry.LOCKTABLE;
IF NOT ItemApplnEntry.FIND('+') THEN
EXIT;
ItemLedgEntry.LOCKTABLE;
IF NOT ItemLedgEntry.FIND('+') THEN
EXIT;
AvgCostAdjmtEntryPoint.LOCKTABLE;
IF AvgCostAdjmtEntryPoint.FIND('+') THEN;
ValueEntry.LOCKTABLE;
IF NOT ValueEntry.FIND('+') THEN
EXIT;
InvtAdjmt.SetProperties(PostingDate,FALSE);
InvtAdjmt.MakeMultiLevelAdjmt;
UpdateItemAnalysisView.UpdateAll(0,TRUE);
In your way, if there will be some bug or change in the standard object, you need to no forget to apply the change to another report too, pepople which will do not know about this, will have problems too etc...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
You're right, I tried to do what I proposed and was unsuccesful do the 'you do not have permission to insert into the item ledger entries' error. Are you aware of any examples of a processing report that runs another report? If not no problem.
Thanks - Chris
Deep
India
Of course, you need to have appropriate license to be able to modify the report. It means, you need to ask your Partner to do that, because you alone cannot make the conditions to not open progress dialog etc.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Chris