Filewatcher rule
William Burgos
[color=#282828][font=helvetica, arial, sans-serif]**** Purpose of the customize rule ****[/font][/color][font=helvetica, arial, sans-serif][color=#282828]Attached is one customize optimizer rule that will add a filewatcher that will check a predefined folder and every time a new file is added to that folder the rule will fire up specified process. In this example it will write to the status bar log that has find a new file.[/color][/font]
[color=#282828][font=helvetica, arial, sans-serif]****Requirements for this customize rule ****[/font][/color]
[font=helvetica, arial, sans-serif][color=#282828]The rule requires coresuite Version 3.40 or higher and SAP Business One 8.8 or higher. It also requires the creation of an extended code functions in coresuite customize.[/color][/font]
[color=#282828][font=helvetica, arial, sans-serif]**** Procedure to use the customize rule ****[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]1. Download the attached *.zip file[/font][/color]
[attachment=220:FileWatcher.zip]
2. Unzip the attach file and you will have a FileWatcher.cocu file and a extendedCode_FileWatcher.txt text file.
[color=#282828][font=helvetica, arial, sans-serif]3. Import the FileWatcher.cocu file in SAP Business One view > Administration > Add-Ons > coresuite customize > Import / Export > Import rules > All Active[/font][/color]
[url="http://forum.coresystems.ch/index.php?app=core&module=attach§ion=attach&attach_rel_module=post&attach_id=211"][img]http://coresystems.invisionconnect.com/uploads/monthly_03_2012/post-4965-0-81089800-1332859565_thumb.jpg[/img][/url][color=#282828][font=helvetica, arial, sans-serif] [/font][/color][url="http://forum.coresystems.ch/index.php?app=core&module=attach§ion=attach&attach_rel_module=post&attach_id=212"][img]http://coresystems.invisionconnect.com/uploads/monthly_03_2012/post-4965-0-15580000-1332859572_thumb.jpg[/img][/url][color=#282828][font=helvetica, arial, sans-serif] [/font][/color][url="http://forum.coresystems.ch/index.php?app=core&module=attach§ion=attach&attach_rel_module=post&attach_id=213"][img]http://coresystems.invisionconnect.com/uploads/monthly_03_2012/post-4965-0-09058000-1332859580_thumb.jpg[/img][/url]
4. In SAP Business One, open Administration > Add-Ons > coresuite customize > Extended Code.
[attachment=221:EC1.PNG]
5. Click on the Edit button for the Using/Import statements. Add to the code the following line: "using System.IO;" press the save button (floppy disk icon) and close window.
[attachment=222:ec2.PNG]
6. Click on the Edit button for the Global methods and variables. Open the extendedCode_FileWatcher.txt file using notepad and copy/paste the code into the window.
[attachment=223:ec3.PNG]
7. Press the save button and close window.
[color=#282828][font=helvetica, arial, sans-serif]8. In SAP Business One, open Administration > Add-Ons > coresuite customize > Optimizer.[/font][/color]
[attachment=224:OP1.PNG]
[color=#282828][font=helvetica, arial, sans-serif]9. Double click on the rule Filewatcher and the code window will open.[/font][/color]
[attachment=225:op2.PNG]
[color=#282828][font=helvetica, arial, sans-serif]10. Change the C:\temp for the folder you want to watch, save and click the active checkbox.[/font][/color]
[font=helvetica, arial, sans-serif][color=#282828]>> Every time a file is added to the specified folder you should get a message on the status bar stating that a new file has been added. Toi change the behavior of the filewatcher, just add your custom code on the Extended Code function watcher_FileCreated.[/color][/font]
0
Please sign in to leave a comment.
Comments
0 comments