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
- Connect to Server
- In any browser, navigate to http://localhost:12556/chapi/HomePage/ChapiDocumentationChapiddler.html
- Ensure Get is selected in the dropdown.
- Enter the text below in the URL field next to the Submit button.
http://localhost:12556/chapi/database
- Find the value of the property called name in the Returned Output section.
- 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":""}]
- If there is a space in the name then be sure to use %20 in place of the space when specifying the databasename name later on in your calls. Ex: Store%20Data
- 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
- Connect to Server.
- In any browser, navigate to http://localhost:12556/chapi/HomePage/ChapiDocumentationChapiddler.html
- Launch SQL Management Studio and log in. Create a new query using the customer's live database.
- Execute this query:
SELECT id FROM transheader WHERE transactiontype = 1 AND ordernumber = xxxxx
- 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
- Change the dropdown from Get to Delete and click Submit.
- Output should return a “1” not a zero.
- 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
- Connect to Server.
- In any browser, navigate to http://localhost:12556/chapi/HomePage/ChapiDocumentationChapiddler.html
- 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=
- Replace with the username for that employee. Usernames are case sensitive.
- Click Submit.
- 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