Changing the case state from partial to complete through batch logic

Discussions about editing and cleaning data
Forum rules
New release: CSPro 8.0
Post Reply
juanf11
Posts: 12
Joined: July 7th, 2020, 2:19 pm

Changing the case state from partial to complete through batch logic

Post by juanf11 »

Hello.-

I'm trying to use logic in a batch application to change the status of a case from partial to complete. The purpose is to hide 'complete' cases from data input so that their case list isn't bloated.

Is there any way to achieve this? Thanks.
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Changing the case state from partial to complete through batch logic

Post by htuser »

It's very easy to do that.

One way is to use sqlquery function in a batch application.

You should update the case table in the csbd/csdbe file. Please update the column partial_save_mode to zero: partial_save_mode=0 for cases you want to change from partial to complete.
For theses same cases, i would also update partial_save_field_name=null;, partial_save_level_key=null; partial_save_record_occurrence=null; partial_save_item_occurrence=null; partial_save_subitem_occurrence=null;

You must write the sqlquery code in the preproc of the Level PROC of the batch application.

And sync the resulting csdb/csdbe file to server.

Please kept in mind that, using sqlquery to modify csdb/csdbe data can lead to serious problem to csprousers who don't understand very well csdb/csdbe file architecture.
So, i advise you to use a copy of your data before change and analyzing results in CSPro DataViewer and DB browser for SQlite or SQLite Studio before sync results to servers.

Hope this help you.
G.VOLNY, a CSProuser from Haiti, since 2004
juanf11
Posts: 12
Joined: July 7th, 2020, 2:19 pm

Re: Changing the case state from partial to complete through batch logic

Post by juanf11 »

Sorry.

It might be because I'm not familiar with the sqlquery function, and the provided documentation only provides examples as to how to read data and generate a record, list, or array. But not on how to modify the .csdb file through the batch application.

Is there any example you could provide? I just want to set the case to completed when one or several rules are met (ex. if a certain field was filled), preferably through the batch application provided in cspro.

Code: Select all

PROC FIELD/LEVEL
	IF ($ <> NotAppl) then
	----SET THIS CASE TO COMPLETED---
	ENDIF;
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Changing the case state from partial to complete through batch logic

Post by htuser »

Dear Juan,
Please send to me a sample of your csdb data with instructions to cases to be set to completed as a private message.
I'll send to you the batch application example.
Best,
G.VOLNY, a CSProuser from Haiti, since 2004
juanf11
Posts: 12
Joined: July 7th, 2020, 2:19 pm

Re: Changing the case state from partial to complete through batch logic

Post by juanf11 »

Hello.-

Sorry for the delay. I have sent the file with instructions through private message.

Best regards.
Post Reply