OBJECT Form 59003 Checklist Make Navision Backup { OBJECT-PROPERTIES { Date=12.10.07; Time=16:46:29; Modified=Yes; Version List=EXP-GesNeuAnalge; } PROPERTIES { Width=10890; Height=3410; CaptionML=[DEU=Checkliste Datensicherungserstellung; ENU=Checklist Make Navision Backup]; OnOpenForm=BEGIN //01 EXP - RKA + Description := STRSUBSTNO(Text0002,COMPANYNAME,TODAY); CurrForm.txtFilename.ACTIVATE(); //01 EXP - RKA - END; } CONTROLS { { 1 ;CommandButton;6050 ;2640 ;2200 ;550 ;HorzGlue=Right; VertGlue=Bottom; CaptionML=[DEU=&Erstellen; ENU=Create Backup]; OnPush=VAR i@1001 : Integer; BEGIN //01 EXP - RKA + IF (Description = '') THEN Description := STRSUBSTNO(Text0002,COMPANYNAME,TODAY); IF (Filename = '') OR (Filename = STRSUBSTNO(Text0002,COMPANYNAME,TODAY)) THEN ERROR(Text0003); IF ISCLEAR(WSHShell) THEN CREATE(WSHShell); IF ISCLEAR(Timer) THEN CREATE(Timer); Timer.Interval(10); Timer.Enabled(TRUE); //01 EXP - RKA - END; } { 3 ;Frame ;220 ;880 ;10450;1540 ;HorzGlue=Both; VertGlue=Both; ShowCaption=No } { 4 ;TextBox ;3850 ;1100 ;6600 ;440 ;HorzGlue=Both; ParentControl=3; InFrame=Yes; CaptionML=[DEU=Beschreibung; ENU=Description]; SourceExpr=Description } { 5 ;Label ;440 ;1100 ;3300 ;440 ;ParentControl=4 } { 6 ;TextBox ;3850 ;1760 ;6600 ;440 ;Name=txtFilename; HorzGlue=Both; ParentControl=3; InFrame=Yes; CaptionML=[DEU=Dateiname; ENU=Filename]; SourceExpr=Filename; OnAssistEdit=BEGIN //01 EXP - RKA + Filename := CMDMgmt.OpenFile(Text0001,STRSUBSTNO(Text0002,COMPANYNAME,TODAY) + '.fbk',4,'*.fbk',1); IF (STRPOS(Filename,':\') = 0) THEN Filename := ''; //01 EXP - RKA - END; } { 7 ;Label ;440 ;1760 ;3300 ;440 ;ParentControl=6 } { 2 ;CommandButton;8470 ;2640 ;2200 ;550 ;HorzGlue=Right; VertGlue=Bottom; PushAction=FormHelp; CaptionML=DEU=&Hilfe } { 8 ;Label ;220 ;0 ;10450;770 ;HorzGlue=Both; VertGlue=Top; HorzAlign=Center; ForeColor=3368703; FontSize=15; FontBold=Yes; LeaderDots=No; CaptionML=[DEU=GARAK - Navision Datensicherung; ENU=GARAK - Navision Backup] } } CODE { VAR CMDMgmt@1001 : Codeunit 412; WSHShell@1000 : Automation "{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} 1.0:{72C24DD5-D70A-438B-8A42-98424B88AFB8}:'Windows Script Host Object Model'.WshShell"; Timer@1003 : Automation "{3B311C81-140E-11D5-8B18-00D0590B4EC5} 1.0:{3B311C92-140E-11D5-8B18-00D0590B4EC5}:'Navision Timer 1.0'.Timer" WITHEVENTS; ShellIsSend@1005 : Boolean; ShellIsSend2@1006 : Boolean; Description@1007 : Text[50]; Filename@1008 : Text[1024]; Text0001@1002 : TextConst 'DEU=Backup speichern;ENU=Backup save.'; Text0002@1009 : TextConst 'DEU=Backup %1 vom %2;ENU=Backup %1 by %2'; Text0003@1010 : TextConst 'DEU=Dateiname ist anzugeben;ENU=Fill out filename'; Text0004@1000000000 : TextConst 'DEU=%xs;ENU=%tb'; EVENT Timer@1003::Timer@1(Milliseconds@1000 : Integer); BEGIN //01 EXP - RKA + IF NOT ShellIsSend THEN BEGIN WSHShell.SendKeys(Text0004); ShellIsSend := TRUE; END ELSE BEGIN IF NOT ShellIsSend2 THEN BEGIN WSHShell.SendKeys(Description); WSHShell.SendKeys('{DOWN}'); WSHShell.SendKeys(Filename); WSHShell.SendKeys('{DOWN}'); WSHShell.SendKeys('{Enter}'); WSHShell.SendKeys('{Enter}'); ShellIsSend2 := TRUE; Timer.Enabled(FALSE); END; END; //01 EXP - RKA - END; EVENT Timer@1003::TimerError@2(ErrorString@1000 : Text[1024]); BEGIN END; BEGIN { *---------------------------------------------* > Copyright XXXXXXXXXXXXXXXXXXXXXXXX > > XXX > *---------------------------------------------* Nr. Modul Datum Krzel Beschreibung } END. } }
Comments
I must ask a big thanks to Kine for idea with BEEP function
http://msmvps.com/blogs/kine/archive/2007/09/07/powerfull-command-in-microsoft-dynamics-nav-beep.aspx#comments
This my tool base on this means - tool for create a NAV release from a lot objects
http://www.geocities.com/yagaponov/Navision/Release/
So can be this help you
But I want to know from U how to set the time to take Backup automatically as the code tells.Because, there is no option to set time manually in the form.
Any help ...?
Here you can rznd reports or Codeunits.
Store this Code into an CU and than run the CU from Sheduler
Thanks..
Can any one help....................
i have downloaded one object to take navision backup automatically from the client .But How to set time to take backup at certain intervals.When i set a time interval for the first time its taking backup automatically but next time its not taking backup ,because message coming as Backup complted successfully.
Due to this reason its generating next backup how to avoid that message.
http://www.mibuso.com/forum/viewtopic.php?t=20036
http://www.BiloBeauty.com
http://www.autismspeaks.org
please.................Is it for automatic Backup?
If you click on the finalization tab you'll see it will ask you to create a scheduled task.
http://www.BiloBeauty.com
http://www.autismspeaks.org
SQL backup works perfectly well for my case, since we are running Navision with MS-SQL database. The entire database is backed up once daily, and all transactions are being backed up very 2 hours. All of these jobs are managed and handled beautifully by SQL server.
============= end update 1/27/2010 ======================
Thanks for your code. It works.
However, if I set them timeinterval value to 1 hour (3600000), the sendkey commands fail to set the values of those textboxes (description and filename) in the backup-database window. I am trying to test to see whether we could have a Navision session running 24/7 with timer set to be triggered every 1 hour. We want to have the dabase backed up only 1 per day, on certain time in the evening; such as, 10:00PM.
The timer is unable to sendkey to the backup windows.
Any advice or suggestion(s)?
Thanks.
http://dynamicsuser.net/blogs/kine/arch ... -beep.aspx
http://www.BiloBeauty.com
http://www.autismspeaks.org
It does not work.
I will try few more times.
Thanks all for your response.
If I set the timer's interval back to 10, the routine works perfectly.
Any advice or suggestions?
Thanks.
http://www.BiloBeauty.com
http://www.autismspeaks.org
"DW NavBackup - Navision Backup Tool" It's an external application which run the fin.exe and do the same (Sending keystrokes) like the example in this post.
The tool in this post here, you can for example use with the job Sheduler ...
Regards
Can anyone help me know whether it is possible to take a NAV backup (.fbk) with system startup, not NAV startup???
Deep
India
A variable was expected, for example
MyVar
Customer.Name
May I know whether I missed something?
Thanks.
I have imported the same object, but when i am trying to run the form its throwing an error 'file out of filename'.
i have debugged the code and later on i found that the error is coming from codeunit common dialog managment when the ocx control is trying to create a backup file.
i am trying this on NAV 2009, please help me what can i do???
its quite urgent.
Regards,
Deepika
This post is from many years ago and since you're on version 2009 why just not use the SQl backup?
http://www.BiloBeauty.com
http://www.autismspeaks.org
If you are on native, migrate to SQL Server so you can do SQL Backups.
Just a guess: I think your backup is larger than 2GB (old FAT-limit of NAV), so it needs to create a second backup file.
With some older versions, you need to let the name end in a number (e.g. c:\backup\native_backup_01.fbk), otherwise it gives an error.
With NAV2009R2 (I don't remember for 2009SP1) this is not needed.
If you want urgent support, then buy a support ticket with Microsoft.
Putting urgent in your message is not the right way to get a response in this forum.
Please see Forum Rule(s) #3.2: Forum Rules.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!