2.6 Exporting from Handyman after PDA sync

The backoffice system can receive new and updated orders immediately after a successful synchronisation of a handheld client. This can be done by starting an executable file or by invoking a COM component. A third method is to poll the database to check if there are any modified orders to export.

The external components can of course also be used for importing data to Handyman, for duplicating data (exporting to two or more backoffice systems), etc.

The class ehmInterface.ExternalComponent can be used to register the external application or component that Handyman should invoke when client synchronisation is done.

This class has the following methods:

 Name  Type  Comment
 AddComponent()  Void  
 AddFunction()  Void  
 RemoveComponent()  Void  
 RemoveFunction()  Void  
 SetSyncType(enSYNC_Type)  Void  
 GetSyncType  Long  
 enSYNC_Type  Enum

 0 : File based
 1 : COM based 


Using a COM dll
When using the AddComponent method the parameter should be ComponentName.ClassName as a string.
Example:

AddComponent(“MyComponent.MyClass”)
AddFunction(“MyFunction”)


Handyman will run this code:

Set oRef = CreateObject(“MyComponent.MyClass”)
oRef.MyFunction


Using an executable or batch file

AddComponent(“MyExe.exe”)


Polling the database
The method ExportDataReady will return true when Handyman has any orders to export.

Note:
It is important to avoid looping software in a function like this. A function based on a repeating timer is a common way to implement this.