CSPro have a good support for duplicate cases?

Discussions about editing and cleaning data
Post Reply
lestcape
Posts: 24
Joined: August 27th, 2016, 1:11 pm

CSPro have a good support for duplicate cases?

Post by lestcape » August 19th, 2020, 2:49 am

How we can delete the wrong duplicate case while conserved the right one in the same device?

I know we can use the delcase (https://www.csprousers.org/help/CSPro/d ... ction.html) function to delete a case by ids, but what happens when we have a duplicate and we want to preserved the right and delete only the wrong?

Can CSPro tell us directly and easy the guid of the current case?
Can CSPro load a case (https://www.csprousers.org/help/CSPro/l ... ction.html) by the guid?

EdIt: I have an idea for the first question of delete a duplicate (https://www.csprousers.org/help/CSPro/s ... ction.html):

sqlquery(DICT_NAME, "UPDATE cases SET cases.deleted=1 WHERE cases.id = '1bb5465b-19a0-4866-8791-0cdc9fefcf5a';");

But that should not be the only solution or it will be? Anyway the other questions remain as a problem to me.

Thanks in advance...

Gregory Martin
Posts: 1418
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: CSPro have a good support for duplicate cases?

Post by Gregory Martin » August 19th, 2020, 8:08 am

You can get case's UUID (once it's loaded) by doing this:
string case_uuid = uuid(DICT_NAME);
You can load a specific case using the UUID by using the locate function (starting with CSPro 7.4): https://www.csprousers.org/help/CSPro/l ... ction.html
locate(DICT_NAME, uuid, case_uuid);
loadcase(DICT_NAME);

// delete this particular duplicate
delcase(DICT_NAME);

josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: CSPro have a good support for duplicate cases?

Post by josh » August 19th, 2020, 8:10 am

You can use the UUID function to get the UUID of the current case. You can also pass a UUID to the locate function to load a case by UUID. So if you know the UUID of the case you want to delete you can use locate and retrieve and to load and then declass to delete it. For example:

Code: Select all

if locate(SIMPLECAPI_DICT, uuid, "55d27748-9ddf-48ff-9d3f-7447fc5cda5c") and retrieve(SIMPLECAPI_DICT) then
  delcase(SIMPLECAPI_DICT);
 endif;
Another way to find duplicate cases is to use the set access statement with CaseStatus.Duplicate on an external dictionary in order to only load the duplicate cases.

lestcape
Posts: 24
Joined: August 27th, 2016, 1:11 pm

Re: CSPro have a good support for duplicate cases?

Post by lestcape » August 19th, 2020, 2:30 pm

Thanks both, that answer fully my questions. CSPro have a good support for duplicate starting with CSPro 7.4.

Code: Select all

locate(DICT_NAME, uuid, case_uuid);
was the useful addition that I didn't know.
Regards.

Post Reply