Optimizing Tables in Job Scheduler

rjansenrjansen Member Posts: 2
edited 2006-05-29 in Navision Attain
Does anyone know if it is possible to optimize the Navision tables in a batch run, such as the job scheduler?

We are using the C/Side database, not the SQL. I know that for SQL there are many other options, but not for C/Side.

Comments

  • kinekine Member Posts: 12,562
    I think, that there is no tool to run Table optimization within C/AL code. It is same as start Navision Backup...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • MIMI Member Posts: 20
    rjansen wrote:
    Does anyone know if it is possible to optimize the Navision tables in a batch run, such as the job scheduler?

    We are using the C/Side database, not the SQL. I know that for SQL there are many other options, but not for C/Side.

    Hi,

    I disagree with kine.
    There is a possiblity to optimize tables and also to create Navision backups.
    You have to write a script using the windows scripting host.
    I wrote a script to close and restart 4 different Navision sessions and a script to optimize tables like you are looking for.
    If you don't know how to create such scripts send me an email and I'll send you the necessary script


    best regards

    MI
  • kinekine Member Posts: 12,562
    I know ebaout external applications and scripting for this purpose, but question was
    if it is possible to optimize the Navision tables in a batch run, such as the job scheduler

    For me it means to have possibility to do it from Navision (C/AL)... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • bettenridbettenrid Member Posts: 1
    Hello MI,

    is it possible to receive your WSH scripts ?

    best regards

    Betten Rid
  • aknakn Member Posts: 2
    Hi,

    I like to get your script for optimize the Navision Database by an batch job. Is it possible to receive it?

    regards
    akn
    MI wrote:
    rjansen wrote:
    Does anyone know if it is possible to optimize the Navision tables in a batch run, such as the job scheduler?

    We are using the C/Side database, not the SQL. I know that for SQL there are many other options, but not for C/Side.

    Hi,

    I disagree with kine.
    There is a possiblity to optimize tables and also to create Navision backups.
    You have to write a script using the windows scripting host.
    I wrote a script to close and restart 4 different Navision sessions and a script to optimize tables like you are looking for.
    If you don't know how to create such scripts send me an email and I'll send you the necessary script


    best regards

    MI
  • jesstyljesstyl Member Posts: 15
    Hi MI,

    I would like to have your script for optimize the Navision Database by scheduling too. Is it possible?

    regards
    :wink:
  • Alex_ChowAlex_Chow Member Posts: 5,063
    Can you just post the script here? I think a lot of people are interested in it.
  • DenSterDenSter Member Posts: 8,307
    It's been more than a year that he wrote this, and his post count is 4. I do not think he is on mibuso anymore, sxo don't count on getting that script. Maybe this thread should be closed.
  • ara3nara3n Member Posts: 9,256
    Hello Here is a form that does it. Import it or create a new one. Optemize is a table with PK of "Table ID" So create a separate table. Enjoy
    OBJECT Form 50009 optemize
    {
      OBJECT-PROPERTIES
      {
        Date=03/02/06;
        Time=10:30:27 PM;
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        Width=8000;
        Height=8000;
        Visible=No;
        TimerInterval=150;
        OnOpenForm=BEGIN
                     IF ISCLEAR(wscript) THEN
                       CREATE(wscript);
                   END;
    
        OnQueryCloseForm=BEGIN
                           IF State = 100 THEN
                             EXIT(FALSE)
                           ELSE
                             EXIT(TRUE);
                         END;
    
        OnTimer=BEGIN
                  IF State = 0 THEN BEGIN
                     IF NOT Optemize.FIND('-') THEN
                       CurrForm.CLOSE;
                     tableinformation.SETRANGE("Table No.",Optemize."Table ID");
                     IF tableinformation.FIND('-') THEN BEGIN
                       State := 2;
                       EXIT;
                     END ELSE
                       State := 1
                  END;
    
                  IF State = 1 THEN BEGIN
                    IF Optemize.NEXT = 0 THEN
                       CurrForm.CLOSE;
                     tableinformation.SETRANGE("Table No.",Optemize."Table ID");
                     IF tableinformation.FIND('-') THEN BEGIN
                        State := 2;
                     END ELSE BEGIN
                        State := 0;
                     END;
    
                  END;
    
                  IF State = 2 THEN
                    wscript.SendKeys('%f');
                  IF State = 3 THEN
                    wscript.SendKeys('b');
                  IF State = 4 THEN
                    wscript.SendKeys('i');
                  IF State = 5 THEN
                    wscript.SendKeys('%B');
                  IF State = 6 THEN
                    wscript.SendKeys('+{F7}');
    
                  IF State = 7 THEN
                    wscript.SendKeys('table no.');
    
                  IF State = 8 THEN
                    wscript.SendKeys('{TAB}');
                  IF State = 9 THEN
                    wscript.SendKeys(FORMAT(Optemize."Table ID"));
                  IF State = 10 THEN
                    wscript.SendKeys('^{DOWN}');
                  IF State = 11 THEN
                    wscript.SendKeys('{ENTER}');
                  IF State = 12 THEN
                    wscript.SendKeys('^a');
                  IF State = 13 THEN BEGIN
                    wscript.SendKeys('%o');
                    wscript.SendKeys('y');
                  END;
    
                  IF State = 100 THEN BEGIN
                    wscript.SendKeys('{ESC}');
                    wscript.SendKeys('{ESC}');
                    wscript.SendKeys('{ESC}');
    
                  END;
    
                  IF State = 100 THEN
                    State := 0;
    
                  State += 1;
                END;
    
      }
      CONTROLS
      {
      }
      CODE
      {
        VAR
          State@1000000000 : Integer;
          wscript@1000000001 : Automation "{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} 1.0:{72C24DD5-D70A-438B-8A42-98424B88AFB8}:'Windows Script Host Object Model'.WshShell";
          Optemize@1000000002 : Record 50009;
          tableinformation@1000000003 : Record 2000000028;
          var@1000000004 : Variant;
    
        BEGIN
        END.
      }
    }
    
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • colingbradleycolingbradley Member Posts: 162
    You could also use Macro Scheduler, see

    http://www.mjtnet.com/

    Have used this for many years, intially the client wanted to have 10 clients logging in, running a report (preview) and then logging out as a test of the system.

    Very useful to do overnight routines such as Inventory Adjust cost/Post to G/L which can take many hours for the larger databases (SQL or native)

    Great product and quite cheap.
    Experience is what you get when you hoped to get money
Sign In or Register to comment.