4.4 Accessing the Resource Planner

Handyman 6.0 Build 698 and newer includes the possibility access the built in Resource Planner.

An application that demonstrates the use of ePocket.COMInterface.dll is included.
Handyman must be installed on your computer to be able to run the application. 

Sample code is provided in a VisualBasic project. If you do not have Visual Basic installed you can look at the source code samples here.

The class for accessing the Resource Planner is located in ePocket.COMInterface.dll and is called ResourcePlanner. An instance of the object can be made (in Visual Basic or Visual FoxPro) with the statement:

oResourcePlanner = CreateObject("ePocket.COMInterface.ResourcePlanner")

There is one function used to access the Resource Planner:

Function definition:

Public Function ShowResourcePlanner( _
                  ByVal aClientID As String, _
                  Optional ByVal aOrderId As String = "", _
                  Optional ByVal aUserID As String = "") As Long   

Sample code:

    Dim oResourcePlanner As Object
Dim llReturnCode As Long
    Dim lsChangedOrders As String
    Set oResourcePlanner = CreateObject("ePocket.COMInterface.ResourcePlanner")
    With oResourcePlanner
        ''' supported languages
        ' Norwegian = "nb-NO"
        ' Swedish = "sv-SE"
        ' Danish = "da-DK"
        ' German = "de-DE"
        ' English = "en-GB"
        ' if culture is not set, it will default to language for company
        ' .Culture = "en-GB" ''' english
        ' Specify order that will have focus, order must exist in Handyman
        ' Official in charge should be specified to get correct access level in the resource planner
        llReturnCode = .ShowResourcePlanner("000", txtOrder.Text, txtOfficialInCharge.Text)
        ' if license for resource planner is not active returncode = -1, otherwise 1
        If llReturnCode = -1 Then
            MsgBox "No license", vbCritical, "Handyman Resource planner"
        End If

        ' get list of changed orders
        lsChangedOrders = .ChangedOrders
        If lsChangedOrders <> "" Then
            ' get order data from handyman using QueryOrder and update own list of orders
        End If

    End With

    Set oResourcePlanner = Nothing