Automatic Load of Objects

This post has 4 Replies | 0 Followers

Male
10 Posts
116 Points
Joined: 2005-10-3
Last Online:
2007-3-13 11:29
Location: Austria
hoed Posted: 2005-11-17 8:00 | Locked
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
  • Filed under:
  • | Post Points: 58
Male
1,362 Posts
15,256 Points
Joined: 2000-12-18
Last Online:
2015-11-25 15:25
Location: Nürnberg/Germany
ModeratorDynamicsNAV
Jörg A. Stryk replied on 2005-11-17 8:12 | Locked
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,

Joerg A. Stryk
NAV/SQL Performance Optimization


Don't forget to the post(s) that solved your problem!

  • | Post Points: 55
Male
10 Posts
116 Points
Joined: 2005-10-3
Last Online:
2007-3-13 11:29
Location: Austria
hoed replied on 2005-11-17 10:31 | Locked
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
  • | Post Points: 5
Male
1,362 Posts
15,256 Points
Joined: 2000-12-18
Last Online:
2015-11-25 15:25
Location: Nürnberg/Germany
ModeratorDynamicsNAV
Jörg A. Stryk replied on 2005-11-17 14:13 | Locked
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>

Joerg A. Stryk
NAV/SQL Performance Optimization


Don't forget to the post(s) that solved your problem!

  • | Post Points: 55
Male
738 Posts
5,697 Points
Joined: 2001-4-27
Last Online:
2014-6-2 10:50
Location: Bangkok, Thailand
walter@kirz replied on 2005-11-17 15:09 | Locked
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)
  • | Post Points: 5
Page 1 of 1 (5 items) | Get this RSS feed