3rd Party Integration - ActiveX OCX - Properties, methods & events

Document data
Document Date: 28 July 2006 - revision 3
Keyfax version : 2.7.0.0 (or greater)
Software required: IIS 5.0+, Internet Explorer 6.0+, SQL Server 2000+
User skill requirements: NT administration. SQL Server DBA. IIS configuration. NT security policies. MSXML editing.
Author: Technical Services keyfax@touch-base.com

Control Properties and Methods:

The following table lists the controls properties and methods available to the programmer. A brief description will outline any additional information to be considered when using the control to exchange data.

  Name Mode Usage Parameters Returns Notes

Keyfax OCX Property

ActionCode

FL

Read only

Item (Long)

String

Keyfax action code (generated from script path)

Keyfax OCX Property

ActionCodeDesc

FL

Read only

Item (Long)

String

FL action code description

Keyfax OCX Property

ActionCount

FL

Read only

None

Long

Count of returned action code sections

Keyfax OCX Property

Additional_Info

RD

Read only

None

String

RD additional information entered by user

Keyfax OCX Property

AdviceCode

RD/FL

Read only

Item (Long)

String

RD/FL advice code (generated from script path)

Keyfax OCX Property

AdviceCodeDesc

RD/FL

Read only

Item (Long)

String

RD/FL advice code description

Keyfax OCX Property

AdviceCount

RD/FL

Read only

None

Long

Count of returned advice code sections

Keyfax OCX Property

AdvicePlainText

RD/FL

Read only

Item (Long)

String

RD/FL advice code full message body text

Keyfax OCX Property

Asset

RD

Read/write

Svalue (String)

File path

RD asset XML file. Must have <Asset> node.

Keyfax OCX Property

AssetID

RD

Read/write

sValue (String)

String

Sets/gets the Asset ID for the current script.

Keyfax OCX Property

AssetString

RD

Write only

Svalue (String)

String

RD asset XML string. Must have <Asset> node.

Keyfax OCX Property

Bookmark

RD

Read/write

Svalue (String)

File path

RD bookmark XML file name (including path).

Keyfax OCX Method

CloseExport

RD/FL

 

None

None

Used after returned XML data is read

Keyfax OCX Property

Contractor

RD

Read Only

Item (Long)

String

RD repair code Contractor ID

Keyfax OCX Property

Communal

RD

Read/write

sValue (String)

String

Sets/gets Communal start-up item (not currently used)

Keyfax OCX Property

Communal_Type

RD

Read only

None

String

RD communal type returned from script

Keyfax OCX Property

Company

RD/FL

Read/write

sValue (String)

String

If this property is to be used (by default Keyfax assumes a single company environment), it MUST be set EVERY TIME the Keyfax.OCX is launched, initialized or after the ‘InitStartup’ method is called. This property is only available in version 3.2.0.0 of the OCX or greater. If supplied, Keyfax will attempt to locate a configuration file of the same name, e.g.

.Company = "HOSTCO01"

will cause Keyfax to look for a configuration file named :

HOSTCO01_CONFIG.XML

Keyfax OCX Property

CompleteBy

RD

Read only

Item (Long)

String

RD complete by date for repair code returned

Keyfax OCX Property

Contractor

RD

Read only

Item (Long)

String

RD/FL contractor for repair code returned

Keyfax OCX Property

CustomCount

RD

Read only

None

Long

Count of returned custom code sections (under development)

Keyfax OCX Property

EnquiryCategory

FL

Read only

None

String

FL enquiry script category title

Keyfax OCX Property

EnquiryCatRef

FL

Read only

None

String

FL enquiry script category ID

Keyfax OCX Property

EnquiryDialog

FL

Read only

None

String

FL enquiry script ID

Keyfax OCX Property

EnquiryText

FL

Read only

None

String

FL enquiry script description (with recorded responses)

Keyfax OCX Property

Export

RD/FL

Read/write

sValue (String)

String

Sets/gets export exchange method (only required if not XML)

Keyfax OCX Property

ExportXML

RD/FL

Read only

None

XML Document

MSXML2 XML Document stream of export.xml

Keyfax OCX Property

Fault_Dialog

RD

Read only

None

String

RD fault script ID

Keyfax OCX Property

FaultText

RD

Read only

None

String

RD fault script description (with recorded responses)

Keyfax OCX Property

GetBookmarkFolder

RD

Read only

None

String

Path to Keyfax Bookmark folder

Keyfax OCX Property

GetKeyfaxWnd

RD/FL

Read only

None

Long

Windows Handle to Keyfax application

Keyfax OCX Property

GetKeyfaxStatus

RD/FL

Read only

None

Long

Keyfax export status value from registry

Keyfax OCX Property

GetKeyfaxStatusText

RD/FL

Read only

None

String

Keyfax export status value description

Keyfax OCX Property

GetNodeByXPath

RD/FL

Read only

sXpath (String)

String

Return XML node text by specifying an Xpath query as parameter. (same as GetStartNodeByXPath)

Keyfax OCX Property

GetSingleNode

RD/FL

Read only

sNode(String), sXPath(String)

String

Return XML node text by specifying sXPath ("Main" = no XPath required if sNode under Enquiry or Fault node, "Common" = no XPath required as sNode is under XML Root, otherwise full Xpath and then Node) and sNode (Name of Node to return text for)

Keyfax OCX Property

GetStartNodeByXPath

RD/FL

Read only

sXpath (String)

String

Return XML node text by specifying an Xpath query as parameter. (same as GetNodeByXPath)

Keyfax OCX Property

HasSubActions

FL

Read only

Item (Long)

Boolean

FL action section has sub action section(s) (see SubActionCode )

Keyfax OCX Property

History

RD

Read/write

sValue (String)

File path

RD history XML file. Must validate to history.dtd file.

Keyfax OCX Property

HistoryString

RD

Write only

Svalue (String)

String

RD history XML string. Must validate to history.dtd file.

Keyfax OCX Method

InitStartup

RD/FL

 

None

None

Used before setting start-up data to clear last values

Keyfax OCX Property

IsKeyfaxActive

RD/FL

Read only

None

Boolean

Check to see Keyfax is loaded into memory

Keyfax OCX Property

IsKeyfaxActive2

RD/FL

Read only

None

Boolean

Check to see Keyfax is loaded into memory. This is the preferred method - it enumerates all open windows. Note: this will return True if the Keyfax Administrator Tools program (KFAdmin.exe) is loaded)

Keyfax OCX Property

Item

RD/FL

Read/write

lValue (Long)

Long

Sets/gets current fault/enquiry (use for multiple faults/enquiries returned in export) by default is set at '1'

Keyfax OCX Property

ItemCount

RD/FL

Read only

None

Long

Count of faults/enquiries returned in export data

Keyfax OCX Property

LA_Code

FL

Read/write

sValue (String)

String

Sets/gets start-up Local Authority code for add-in database functions of FL

Keyfax OCX Method

LaunchKeyfax

RD/FL

 

sParam (string)

Long

Used to start Keyfax, the sParam parameters are the usual startup command line parameters (ie '/S:XML /E:XML /M:RD /V:MIN /U:operator /P:Global /H:1'). Will return the Status.

Keyfax OCX Property

LoadExport

RD/FL

 

None

None

Used to open export xml file prior to reading properties

Keyfax OCX Property

LogDate

RD/FL

Read only

None

String

Date/time of script process (ie '30 /04/2001 13:45:14')

Keyfax OCX Property

MainCustom

RD/FL

Read only

sNode (String)

String

Custom export node associated to the Repair/Enquiry data. The sNode parameter is used to define the XML Node name required (ie 'Location')

Keyfax OCX Property

Mode

RD/FL

Read/write

sValue (String)

String

Sets/gets start-up Mode, sValue parameter = 'FL' or 'RD'. Mandatory in launch, start-up and export xml (this value must be set before any other properties are set or read)
Note: from version 3.2 RD/FL has superseded the previous modes 'Jobfax'/'Keyfax', although these can at present still be used.

Keyfax OCX Method

NotifyStatus

RD/FL

 

bToggle(Boolean)

None

Used to enable/disable StatusX event for early bound OCX integration

Keyfax OCX Property

OAP_Disability

RD/FL

Read/write

sValue (String)

String

Sets/gets OAP disability start-up item (not currently used)

Keyfax OCX Property

ParentActionCode

FL

Read only

Item (Long)

String

Identifies FL action code parent section from sub action section

Keyfax OCX Property

Password

RD/FL

Read/write

sValue (String)

String

Sets/gets start-up user's password (mandatory in launch and start-up xml), this can use the Global password for users other than administrators

Keyfax OCX Property

Priority

RD/FL

Read only

Item (Long)

String

RD repair/FL action code priority code

Keyfax OCX Property

Reason_Code

RD

Read only

None

String

RD fault reason code

Keyfax OCX Property

Reason_Text

RD

Read only

None

String

RD fault reason code description

Keyfax OCX Property

Recharge

RD

Read only

None

String

RD fault repair is chargeable '1' or '0'

Keyfax OCX Property

Recharge_Code

RD

Read only

None

String

RD fault recharge code (generated from script path)

Keyfax OCX Property

Recharge_Cost

RD

Read only

None

String

RD fault recharge code description

Keyfax OCX Property

Repair_No

RD

Read only

None

String

RD fault repair reference as passed from host

Keyfax OCX Property

Repair_Status

RD

Read only

None

String

RD fault repair status (ie '2' = logged)

Keyfax OCX Property

RepairCode

RD

Read only

Item (Long)

String

RD fault repair code (SOR code generated from script path)

Keyfax OCX Property

RepairCodeDesc

RD

Read only

Item (Long)

String

RD fault repair code short description

Keyfax OCX Property

RepairCount

RD

Read only

None

Long

Count of returned repair code sections

Keyfax OCX Property

RepairNo

RD

Read/write

sValue (String)

String

Sets/gets start-up repair reference (optional in start-up xml), this value will be returned in export Repair_No item

Keyfax OCX Property

Schedule_ID

RD

Read only

None

String

Recorded reference to script, for use in audits and orders.mdb

Keyfax OCX Property

Scheme_Code

FL

Read/write

sValue (String)

String

Sets/gets start-up Housing Scheme code for add-in database functions of FL

Keyfax OCX Property

ScriptPath

RD/FL

Read only

None

String

RD/FL script navigation path

Keyfax OCX Method

SendStartup

RD/FL

 

None

None

Used once start-up properties have been set (this will generate the start-up xml file)

Keyfax OCX Method

SetExportLoadRequestFlag

RD/FL

 

None

Boolean

Used to set export status to -4 at initial load for time out processing

Keyfax OCX Method

SetStartupFlag

RD/FL

 

None

None

Used once start-up properties have been set and SendStartup method has been called (this will give Keyfax the focus for a script session)

Keyfax OCX Property

Site_Visit

RD

Read only

None

String

RD instructions for site visit by contractor/inspector

Keyfax OCX Property

Special_Instructions

RD

Read only

None

String

RD special instructions for contractor/inspector

Keyfax OCX Property

Startup

RD/FL

Read/write

sValue (String)

String

Sets/gets start-up exchange method (only required if not XML)

Keyfax OCX Property

StartupXML

RD/FL

Write only

oData (MSXML2

DomDocument)

None

MSXML2 XML Document object to load into startup.xml. note: SendStartup method not required.

Keyfax OCX Property

Status

RD/FL

Read only

None

Long

FL/RD export status (see status section)

Keyfax OCX Event

StatusX

RD/FL

Event

Status (Long)

Long

Keyfax Status event. Only if OCX is Early Bound and NotifyStatus method has been set at True. This replaces the GetKeyfaxStatus property.

Keyfax OCX Property

SubActionCode

FL

Read only

Item (Long)

String

FL sub action code (see ParentActionCode for parent action section)

Keyfax OCX Property

SubActionCount

FL

Read only

None

Long

Count of returned sub action code sections

Keyfax OCX Property

SubActionKey

FL

Read only

Item (Long)

String

FL sub action named export section (use in IFX exchange to define INI section key name)

Keyfax OCX Property

SubActionValue

FL

Read only

Item (Long)

String

FL sub action data associated to SubActionKey

Keyfax OCX Property

SubCustom

RD/FL

Read only

Item (Long)

sNode (String)

String

Custom export node associated to Repair / Action code. The sNode parameter is used to define the XML Node name required (ie 'Location')

Keyfax OCX Property

Tenancy

RD

Read/write

sValue (String)

String

Sets/gets current fault Q&Aset to select scripts (will use FL.INI default value if not supplied)

Keyfax OCX Property

Tenancy_Type

RD/FL

Read only

None

String

FL/RD Q&Aset used in script

Keyfax OCX Property

Tenant

RD/FL

Read/write

sValue (String)

String

Sets/gets current caller name/address for RD/FL script (displayed in title bar)

Keyfax OCX Property

Tenant ID

RD/FL

Read/write

sValue (String)

String

Sets/gets current caller ID for RD/FL script (passed back to host in TenantID_Ex )

Keyfax OCX Property

TenantID_Ex

RD/FL

Read only

None

String

FL/RD TenantID reference passed from host

Keyfax OCX Property

Tenure_Code

FL

Read/write

sValue (String)

String

Sets/gets current enquiry Q&Aset to select scripts (will use FL.INI default value if not supplied)

Keyfax OCX Property

UnitOfMeasure

RD

Read only

Item (Long)

String

RD unit of measure for repair code returned

Keyfax OCX Property

UnitOfMeasureQuantity

RD

Read only

Item (Long)

Long

RD quantity of units for repair code returned

Keyfax OCX Property

UpdateAssetID

RD

Read Only

Item (Long)

String

Requested property Asset ID requiring updating

Keyfax OCX Property

UpdateCount

RD

Read only

None

Long

Count of returned asset update sections

Keyfax OCX Property

UpdateNewValue

RD

Read only

Item (Long)

String

Requested property Asset node's new value.

Keyfax OCX Property

UpdateXPath

RD

Read only

Item (Long)

String

Requested property Asset node to update.

Keyfax OCX Property

UserCode

RD/FL

Read only

None

String

FL/RD UserName reference passed from host

Keyfax OCX Property

UserName

RD/FL

Read/write

sValue (String)

String

Sets/gets current user for RD/FL script (passed back to host in UserCode )

Keyfax OCX Property

Visibility

RD/FL

Read/write

sValue (String)

String

Sets/gets application start-up visibility (should only be used in LaunchKeyfax method ie /V:MIN = start minimized)

The list of properties refer to matching named elements in the start-up and export XML named elements returned from Keyfax to the OCX.

However, since version 3.2 of Keyfax some additional elements have been added to the export XML, which cannot be read directly from named OCX properties.

In version 3.2 of Keyfax we have added the ability to specify additional elements in the Export XML by configuration templates. This allows customers to define custom elements without the need to recode the OCX interface.

The GetNodeByXPath property can be used to fetch data from these bespoke elements as required.

Sample Keyfax Result reading code, using GetNodeByXPath

With oKeyfax
  '=== Set the Mode to 'RD' or 'FL'
  .Mode = "RD"
  '=== Load result XML and Assign OCX properties
  .LoadExport
  '=== Read the location element of returned XML data
  <location> =   .GetNodeByXPath("Fault/Location")
  <advicecode> = .GetNodeByXPath("//Fault[@name='Fault1']/Advice[@name='Advice1']/AdviceCode")
  <isdeleted> =  .GetNodeByXPath("//Fault[@name='Fault1']/Repair[@name='Repair1']/IsDeleted")
  '=== Close the XML document
  .CloseExport
End With

Items shown in arrow bracketing (<host variables>) indicate host application variables.