Customer FOCUS Software Developers Kit (SDK)
The SDK gives developers of other applications the ability to implement high level functions described below, and allows them to interface with Customer Focus without compromising data integrity.
Otherwise known as an API the SDK comprises of a specific DLL file (CUSTOMERFOCUS.DLL) that can be purchased separately
Platform
Any application using the SDK needs to be Windows based and to run on Windows 2000, XP and 2003, with or without service packs.
General Functions
CF_Init(STRING Path, STRING UserName, STRING Password),SHORT
· for Topspeed databases, checks the database exists on the given path and performs any
initialisation required.
· for MS SQL databases it should be treated as a connection string and a
connection to the DB should be opened and perform any initialisation required.
· Checks the given username and password and remembers what access that user has (??
· returns –1 for invalid login, 1 on success, 0 on any other failure
· this function is able to handle multiple calls – eg. If it is called multiple times it
should drop any existing DB connection or reference and re-initialise itself
Specific Functions
CF_ReadCustomer(STRING), STRING
· If the given string is a valid customer account code, returns String ( [1:60] = Name,
[61:120] = Address1, [121:180] = Address2, [181:240] = Address3, [241:300] = Address4,
[301:360] = Address5, [361:461] = EmailAddress)
· If it is not a valid account code, returns zero length string.
CF_CheckOrderStatus(LONG), SHORT
· given an order number, returns Short ( 0 = Not Found, 2 = New Order , 3 =
Acknowledged, 4 = Being Picked, 5 = Acknl & Being Picked, 6 = Reserved, 7 = Partially
despatched, 8 = Part Desp. & Inv., 9 = Invoiced, 10 = 'Despatched & Inv.', 11 =
Cancelled)
CF_MakePayment(LONG OrderNumber, STRING PaymentReference), SHORT
· raises an invoice for the given order and marks it as paid by credit card
· if a suitable field is available (reference? Notes?) it should add the given
PaymentReference string to the invoice
CF_SetOrderStatus(LONG OrderNumber, SHORT NewStatus), SHORT
· set the given order to the given status
· (if the new status is 8, 9 or 10 should it check that an invoice has been generated?)
· returns 0 if the order was not found
· returns –1 if the given status value was not valid
· otherwise returns the previous status value as defined for CF_CheckOrderStatus
CF_Close(), SHORT
· closes the currently open database connection and performs any other housekeeping
required for program termination
· returns 1 on success, 0 on failure
CF_ReadProduct(STRING ProductCode, STRING CustomerAccount), STRING
· given a product code, reads product info
· when returning pricing, it should take into account any special customer specific pricing,
stock-based pricing, any current discounts etc
· the return string should be split into various fixed length fields – include these fields:
description, USP, alternate description, category, price, all quantity price breaks,
subcategories, unallocated stock level, image path, document path etc.
CF_CopyProducts(STRING FileName), SHORT
· write a list of all products to the given file name in CSV format
· the fields provided should be the same as CF_ReadProduct, but prices and discounts
should ignore any customer specific pricing
· products marked discontinued or unavailable should not be included
· the return value should be –1 for failure, otherwise it should be the number of products
written to the file
CF_CopyCategories(STRING FileName), SHORT
· write a list of all product categories to the given file name in CSV format
· only the ‘CATEGORY’, ‘CATEGORYTYPE’, ‘LEVEL’ and ‘DESCRIPTION’ fields are
needed
· return –1 for failure, otherwise it should be the number of categories written to the file
CF_CopyCustomerPricing(STRING FileName), SHORT
· write a list of all customer specific pricing to the given file name in CSV format
· fields should include customer account ref, product code, and base price
· return –1 for failure, otherwise return the number of entries written to the file
CF_WriteOrder(STRING OrderDetails, STRING CustomerAccount, STRING Status,
STRING OrderReference), SHORT
· CustomerAccount is a customer account reference
· Status is an initial order status, as defined by CF_CheckOrderStatus
· OrderDetails is a string ( [1:x = Product Code, [x:x] = Description, [x:x] = Unit Price,
[x:x] = Quantity, [x:x] = Tax Code, [x:x] = Line Price )
· This function tries to create the order, checking for a valid customer account, valid order
status, and available stock.
· if all checks pass, the order is created
· return 0 for failure due to stock levels
· return –1 for failure due to customer account status (eg. Credit limit?)
· return –2 for failure due to invalid customer account or status
· otherwise return the newly created order number
CF_FindCustomer(STRING CompanyName, STRING PostCode, STRING Phone,
STRING email), STRING
· searches for the customer account which is the closest match to the given details
· use case-insensitive matching on all fields
· search first for a customer contact with an exact match on the email address
· if that fails, search for a matching phone number, ignoring non-digit characters if possible
(perhaps by selecting all phone numbers into a temporary table with non-digits stripped
out, then searching that table for a match)
· if that fails, look for a matching company name AND postcode
· return the customer account code if a match was found
· return a blank string if not
CF_ReadAddress(STRING CustomerAccount, SHORT AddressIndex), STRING
· returns a string containing the details of the address referenced by AddressIndex
· an AddressIndex of 1 should be the first address
· return a blank string if no address has the requested index
CF_WriteAddress(STRING CustomerAccount, SHORT AddressIndex, STRING
AddressDetail), SHORT
· writes a new address on the given customer account
· if AddressIndex is zero or is invalid, creates a new address
· if AddressIndex is non-zero and valid, overwrites that address
· AddressDetail is a string in the same format as that returned by CF_ReadAddress
· return zero on failure, or the index of the address that was written (be careful to return the
resulting index – if the function is given an invalid one, it should be ignored and the return
value would then be the newly created index)
CF_WriteCustomer(STRING CustomerDetails), STRING
· creates a new customer record from the given CustomerDetails (a string containing
multiple fixed length fields TBC)
· returns a blank string on failure or the newly created account reference on success
CF_WriteContact(STRING ContactDetails, STRING CustomerAccount, SHORT
AddressIndex, ), STRING
· creates a new customer record from the given CustomerDetails (a string containing
multiple fixed length fields TBC)
· returns a blank string on failure or the newly created account reference on success
CF_WriteCRM(STRING CRMDetails), LONG
· creates a new CRM entry from the given details (a string containing multiple fixed length
fields TBC)
· fields given should include TYPE, ACCOUNTNO, ACCOUNTTYPE,
PRODUCTNUMBER, ENTEREDBY, CONTACTNAME, PHONENO, EMAIL,
SUBJECT
· automatically insert the create date/time and leave it open
· automatically look up the ENTEREDBY to find the REPCODE
CF_WriteDiary
- Creates a new diary entry from the given details
· fields given should include DATE, TIME, CATEGORY, ALLOCATED TO, ACCOUNT NO, CONTACT & CONTACT EMAIL
CF_WriteCRMAction
Creates a CRM action within an existing CRM Call
CF AmendDiary
Updates or reschedules an existing diary entry
CF InsertupdateMarketingtag
Inserts or updates a marketing tag
CF InsertDocument
Attaches a document path to specific record