Differences

This shows you the differences between two versions of the page.

Link to this comparison view

control_locked_files_chapiddler_corrections [2019/01/30 09:22] (current)
Line 1: Line 1:
 +====== 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.
 +
 +
 +
 + <code>
 +http://localhost:12556/chapi/database
 +</code>
 +  - 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.
 +
 +
 +
 + <code>
 +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":""}]
 +</code>
 +    * 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:
 +
 +
 +
 + <code sql>
 +select id from transheader where transactiontype = 1 and ordernumber = xxxxx
 +</code>
 +  - Copy the id from the query + c10000 and paste it in the URL as shown below.
 +
 +
 +
 + <code>
 +Ex: http://localhost:12556/chapi/lock(1000c10000)?databasename=Store%20Data
 +</code>
 +  - 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.
 +
 +
 +
 +{{::2014-02-07_15_33_09-cannot_log_back_in_to_on_14_-_shendrixcyrious.com_-_cyrious_software_ma.png?nolink&|}}
 +
 +
 +
 +==== 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.
 +
 +
 +
 + <code>
 +http://localhost:12556/chapi/user?databasename=Store%20Data&username=
 +</code>
 +    * 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
 +
 +
 +