Options

Job Queue issue

kmkaotkmkaot Member Posts: 261
edited 2012-04-21 in NAV Three Tier
Dear Friends,

I have some issue with Job queue.

When Job Queue is enables, it is taking one extra session, is it correct??

When a codeunit is entered in Job queue entry, for every ten minutes running, in all days, it is not working, and log is not created and also one session is blocked(??)

Warm regards
KMK

Comments

  • Options
    kinekine Member Posts: 12,562
    What is the problem? That the scheduled CU is not started or that the session is blocked? Have you some NAS started witht he Start up parameter set to start the JOBQUEUE?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    kmkaotkmkaot Member Posts: 261
    The scheduled CU is not started.

    NAS service is seen started.

    With same user name, one session is extra avaiilble in database information.

    I am trying to send report thrugh email. the same CU i have entered in this bloody Job Queue.
    OBJECT Codeunit 50004 CU for Email
    {
      OBJECT-PROPERTIES
      {
        Date=19/04/12;
        Time=[ 4:10:16 PM];
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        OnRun=BEGIN
                fromdate :=0D;
                acp.SETFILTER(acp."New Fiscal Year",'yes') ;
                IF acp.FINDFIRST THEN
                  REPEAT
                    IF DATE2DMY(WORKDATE,3)=DATE2DMY(acp."Starting Date",3)  THEN
                       fromdate:=acp."Starting Date"
                     UNTIL acp.NEXT = 0;
    
                GLAcc.SETRANGE("Date Filter",fromdate,TODAY);
    
    
                IF ISCLEAR(BullZipPDF) THEN
                  CREATE(BullZipPDF);
    
                PDFFilePath := 'E:\Flash\';
                PDFFileName := 'FlashReport_'+FORMAT(DATE2DMY(TODAY,2))+'_'
                               +FORMAT(DATE2DMY(TODAY,1))+'_'+FORMAT(DATE2DMY(TODAY,3)) + '.pdf';
                   MESSAGE(PDFFileName);
                BullZipPDF.Init;
                BullZipPDF.LoadSettings;
                BullZipPDF.SetValue('OutPut', PDFFilePath + PDFFileName);
                BullZipPDF.SetValue('Showsettings', 'never');
                BullZipPDF.SetValue('ShowSaveAS', 'never');
                BullZipPDF.SetValue('ShowPDF', 'no');
                BullZipPDF.SetValue('ShowProgress', 'no');
                BullZipPDF.SetValue('ShowProgressFinished', 'no');
                BullZipPDF.SetValue('SuppressErrors', 'yes');
                BullZipPDF.SetValue('ConfirmOverwrite', 'no');
                BullZipPDF.WriteSettings(TRUE);
    
                REPORT.RUNMODAL(6, FALSE, FALSE,GLAcc);
                //REPORT.RUNMODAL
                IsDone := FALSE;
                i := 0;
                REPEAT
                  IF FILE.EXISTS(PDFFilePath+PDFFileName) THEN BEGIN
                    IF testFile.OPEN(PDFFilePath+PDFFileName) THEN BEGIN
                    MESSAGE('at Done');
                      IsDone := TRUE;
                    END;
                  END;
                  i += 1;
                  SLEEP(1000);
                UNTIL (i > 60) OR IsDone;
    
                IF IsDone THEN BEGIN
                  SenderName := 'Navision';
                  SenderAddress := 'krishna@alotaiba.ae';
                  SendTO := 'krishna@alotaiba.ae';
                  Subject := 'Report.';
                  MESSAGE(PDFFilePath+PDFFileName);
    
                  Email.CreateMessage(SenderName, SenderAddress, SendTO, Subject,
                    'This is an automatic generated email from Navision.  Please do not reply.', FALSE);
                //  Email.AddAttachment(PDFFilePath+PDFFileName);
                   Email.AddAttachment('E:\Flash\'+PDFFileName);
                  Email.Send;
                END;
              END;
    
      }
      CODE
      {
        VAR
          PDFFilePath@1000000000 : Text[250];
          PDFFileName@1000000001 : Text[250];
          DefaultPrinter@1000000002 : Text[100];
          TempDir@1000000003 : Text[100];
          FlashReport@1000000004 : Report 6;
          IsDone@1000000005 : Boolean;
          i@1000000006 : Integer;
          testFile@1000000007 : File;
          SendTO@1000000008 : Text[1000];
          Email@1000000009 : Codeunit 400;
          SenderName@1000000010 : Text[100];
          SenderAddress@1000000011 : Text[1024];
          Subject@1000000012 : Code[50];
          BullZipPDF@1000000013 : Automation "{61CB5BFA-AFE6-4B0F-A4BB-7F3D4999EE52} 3.2:{BEBDC1DF-D793-4F6C-B8FF-E831A1C2595C}:'Bullzip'.PDFPrinterSettings";
          fromdate@1000000014 : Date;
          GLAcc@1000000015 : Record 15;
          acp@1000000016 : Record 50;
    
        BEGIN
        END.
      }
    }
    
    
  • Options
    Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    kmkaot wrote:
    The scheduled CU is not started.

    NAS service is seen started.
    You forgot to tell us the startup-parameter being used by the NAS service.

    kmkaot wrote:
    I am trying to send report thrugh email. the same CU i have entered in this bloody Job Queue.
    If this codeunit is scheduled through the Job Queue module, you need to pass a "Job Queue Entry" record to this. Select properties for this codeunit and fill in the TableNo-property.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • Options
    DenSterDenSter Member Posts: 8,304
    You need to enter the codeunit as an entry in the Job Queue, and set it up for recurring processing.
  • Options
    kmkaotkmkaot Member Posts: 261
    Dear Daniel,

    What is the table No property? any table or 15 for recordset? I used here.

    Warm Regards
    KMK
  • Options
    DenSterDenSter Member Posts: 8,304
    I do not understand what you are asking
  • Options
    clauslclausl Member Posts: 455
    An option could also be to create a SSRS Server side report and have the report run outside of NAV, as suggested here with a Stored Procedure.
    http://www.mibuso.com/forum/viewtopic.php?f=32&t=52805
    Then you can leverage all the cool SSRS features i.e. subscribing to a report: http://msdn.microsoft.com/en-us/library/ms157386(v=sql.105).aspx

    /Claus Lundstrøm
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
  • Options
    skullaskulla Member Posts: 140
    In the codeunit properties in the table no. property you have to use Job Queue Entry (472).
Sign In or Register to comment.