Automatic Load of Objects

Is there any tool to load automatically new/updated objects in Navision clients on different servers.
At the moment we have to export the new/updated objects form our "Master"-System and log-on to the different servers to update each client manual.
It would be a big tiem relief if we could do this automatically.
Thanks

Dan

hoed
  • Well, basically it is possible, but tricky ...

    1. Option:
    Create a script for the "Windows Scripting Host" to import the fob

    2. Option:
    Export each single object from you "master" into a single file by exporting the BLOB reference of the object (of system "Object" table); e.g.

    ExportObject()
    IF NOT Object.GET("Object Type", '', "Object ID") THEN
    EXIT;

    CLEAR(Filename);
    FileDialog.Filter := Text001;
    FileDialog.ShowSave();
    Filename := FileDialog.FileName;
    IF (Filename <> '') THEN BEGIN
    Object.CALCFIELDS("BLOB Reference");
    IF Object."BLOB Reference".HASVALUE THEN
    Object."BLOB Reference".EXPORT(Filename, FALSE);
    END;

    On the "slaves" now you can import the BLOB Reference again; e.g.

    ImportObject()
    IF NOT Object.GET("Object Type", '', "Object ID") THEN BEGIN
    IF NOT CONFIRM(Text002, FALSE, "Object Type", "Object ID") THEN
    EXIT;
    IF NOT Object.RECORDLEVELLOCKING THEN
    Object.LOCKTABLE(TRUE);
    Object.INIT;
    Object.Type := "Object Type";
    Object."Company Name" := '';
    Object.ID := "Object ID";
    Object.Name := 'New Object';
    Object.Compiled := TRUE;
    Object.INSERT(TRUE);
    END ELSE IF NOT CONFIRM(Text003, FALSE, "Object Type", "Object ID") THEN
    EXIT;

    CLEAR(Filename);
    FileDialog.Filter := Text001;
    FileDialog.ShowOpen();
    Filename := FileDialog.FileName;
    IF (Filename <> '') THEN BEGIN
    IF NOT Object.RECORDLEVELLOCKING THEN
    Object.LOCKTABLE(TRUE);
    Object."BLOB Reference".IMPORT(Filename, FALSE);
    Object.Modified := TRUE;
    Object.Date := TODAY;
    Object.Time := TIME;
    Object.MODIFY(TRUE);
    END;

    To do this automatically you could use the "Job Scheduler" or ExpandIT "Launch Utility" (expandit.com).

    Hope this helps a little ...

    Regards,

    Jörg A. Stryk
  • Thanks,

    could you please give me an example for the Windows Scripting Host ? At the moment i cannot imagine how to connect to Navision and to import with this.

    Regards,

    Dan

    hoed
  • Sorry, I can't ... we are doing it with the binary import/export stuff ...
    but here a link to some valuable info and examples about the WSH: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthsendkeys.asp

    Once I tried it with the WSH, but I never finished (sorry, have no more script-tries); it should start like that
    <package>
    <job id="importobjects">
    <script language="JScript">
    var WshShell = WScript.CreateObject("WScript.Shell");
    WshShell.Run("C:\Program Files\Microsoft Business Solutions-Navision\fin.exe id=template.zup");
    WScript.Sleep(500);
    WshShell.SendKeys ("+{F12}");
    WScript.Sleep(100);
    WshShell.SendKeys("%fo");
    </script>
    </job>
    </package>

    Jörg A. Stryk
  • quote:
    It would be a big tiem relief if we could do this automatically.
    Originally posted by hoed - 2005 Nov 17 : 07:00:37



    It could be done with the Replicator for Navision as well.

    See www.databackbone.com (again: I do NOT get any commission. But I like the solution)

    walter@kirz
Related