Report 795 Adjust Cost - Item Entries on Job Sch

gadzilla1gadzilla1 Member Posts: 316
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

Answers

  • kinekine Member Posts: 12,562
    1) Some modifications are needed like add conditions to not open dialog box with progress when the process is running (NAS cannot display the dialog...) - it means adding "IF GUIALLOWED then" before each call of some function with Dialog variable.
    2) You can add some funtionality to set the parameters of the report through parameters of the JobQueue
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • gadzilla1gadzilla1 Member Posts: 316
    Thank you for the reply.

    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);
  • kinekine Member Posts: 12,562
    Better is to create new report, which will take parameters from outside (if you need) and will call the standard report which will have only additional function to set the startup parmeters through code. In this case you will not have doubled the application logic, it will be easier for maintenance, it is more clear etc.etc.

    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...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • gadzilla1gadzilla1 Member Posts: 316
    Hi Kamil,

    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
  • DeepDeep Member Posts: 569
    Regards,

    Deep
    India
  • kinekine Member Posts: 12,562
    gadzilla1 wrote:
    Hi Kamil,

    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

    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.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • gadzilla1gadzilla1 Member Posts: 316
    Thank you very much to all...the last two posts (and link) helped my understanding a great deal. I will put as solved, and ask my partner for assistance.

    Chris
Sign In or Register to comment.