prevention from deleting cases didn't worked

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
lusia
Posts: 49
Joined: March 28th, 2018, 4:56 am

prevention from deleting cases didn't worked

Post by lusia »

Dear CSPro Expert,
I encountered a problem when I tried to prevent cases deletion in csdb.
I've checked the examples in this forum. So far, all examples are for two or more level applications.
Could I use the Lock = Delete for my one level application?
Here is my script:

Code: Select all

PROC GLOBAL
file PFFName;

function StartWork()
								
		setfile(PFFName, "dummy\test_char.pff", create);
		filedelete(PFFName);
		filewrite(PFFName, "[Run Information]");
		filewrite(PFFName,"Version = CSPro 7.1");
		filewrite(PFFName,"AppType = Entry");
		//filewrite(PFFName,"Description = My Survey");
		filewrite(PFFName,"");
		
		filewrite(PFFName,"[DataEntryInit]");
		filewrite(PFFName,"Lock = Delete,Stats");
		filewrite(PFFName,"Interactive = Ask");
		filewrite(PFFName,"");
		
		filewrite(PFFName,"[Files]");
		filewrite(PFFName,"Application = .\test_char.ent");
		filewrite(PFFName,"InputData = .\test_char.csdb");
		filewrite(PFFName,"");
				
		close(PFFName);
		execpff("dummy\test_char.pff");
		stop(1);

	end;

PROC TEST_CHAR_FF
preproc
	StartWork();
I still can delete cases using this script. I don't know what wrong is with my script.

Kindly please help me.
Thank you before and after.

Regards,
lusia
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: prevention from deleting cases didn't worked

Post by aaronw »

Disabling case deletion is not related to whether the app is one or two level.

The PFF allows you to specify run-time parameters and then launch the application. So in your case you want to specify lock=delete.

There are two scenarios though:
  • 1. The PFF is static. Use the PFF editor to set lock=delete and then use the same PFF each time you launch the application. No logic is needed.
  • 2. The PFF is dynamic. For example, you have a menu application that allows your interviewer to open a particular case. Here your PFF will be slightly different each time. Your menu application will write out the PFF and then launch the 2nd application.
I have attached a very simple example of a static PFF. Take a look at the example project "CAPI Census" for an example of a dynamic PFF (deletion is not disabled). The example is installed with CSPro under "Documents\CSPro\Examples 7.1\1 - Data Entry."
Attachments
no-delete.zip
(2.22 KiB) Downloaded 229 times
lusia
Posts: 49
Joined: March 28th, 2018, 4:56 am

Re: prevention from deleting cases didn't worked

Post by lusia »

Dear Aaron.
Thanks for the suggestions.
I used the first scenario.

Following up your suggestion and example, I tried to set lock=delete via PFF Editor, on the Options menu I enabled the Expert Mode. And then on [DataEntryInit] ==> Lock Features, I checked option Deleting Cases.
In desktop mode, it worked perfectly. I'm checking this on tablet. I think it will work too.

Thank you very much, Aaron

Regards,
lusia
Post Reply