Table of Contents

Concept

The CHAPI service is responsible for all locking, unlocking, and refreshing of database records within Control. At times these locks can be held in the system even when there is not an active version of Control running that has the file locked. You can utilize the Chapiddler utility to release any locked records once all other possible actions have been attempted. Chapiddler simply serves as a tool to submit calls directly to the CHAPI service.

Cautions

When using the Chapiddler, data can be modified and/or deleted if the wrong steps are taken. Use caution when doing this on a live database.

These steps should only be performed by a Cyrious Software Technician.

Obtaining the Database Name

When using Chapiddler you will need to specify the database name on which CHAPI should attempt to communicate. Once you have this name, it should appended to all calls that are made in Chapiddler.

Steps

  1. Connect to Server
  2. Ensure Get is selected in the dropdown.
  3. Enter the text below in the URL field next to the Submit button.
http://localhost:12556/chapi/database
  1. Find the value of the property called name in the Returned Output section.
  2. The value immediately after that response is your database name (i.e., Store Data, Store_Data, etc.). Below is a sample of what your response in the Returned Output section may look like.
200 OK
Content-Length: 212
Content-Type: application/json; charset=utf-8
[{"name":"Store Data","application":"Control","isactive":true,"databasetype":"SQL","path":"SERVER\\Cyrious,1433",
"databasename":"StoreData","description":"Control Store Data Group","hotfolderpath":""}]
  1. Now that you have the name, you can use it in any of the calls below when initiating unlocks or other commands.

Order is locked

Error

Message:

Record is being edited by

Resolution

  1. Connect to Server.
  2. Launch SQL Management Studio and log in. Create a new query using the customer's live database.
  3. Execute this query:
SELECT id FROM transheader WHERE transactiontype = 1 AND ordernumber = xxxxx
  1. Copy the id from the query + c10000 and paste it in the URL as shown below.
Ex: http://localhost:12556/chapi/lock(1000c10000)?databasename=Store%20Data
  1. Change the dropdown from Get to Delete and click Submit.
  2. Output should return a “1” not a zero.
  3. The record lock is now deleted and the user should be able to edit the order.

User not able to log into Control

Error

Message:

already logged in to at '', cannot add to logged-in user list.

Resolution

  1. Connect to Server.
  2. To remove the user (log them out), select Delete from the dropdown and enter the following in the URL field.
http://localhost:12556/chapi/user?databasename=Store%20Data&username=
  1. Click Submit.
  2. The last value you receive in the response should be a “1”. If you receive a “0”, the user was not removed or was never logged in.

Source

Contributor: TGilbert, SHendrix, Cyrious Software

Updated: 02/07/2014

Version: Control 5.xx