CSPro closes after entering a case

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
Don
Posts: 55
Joined: February 15th, 2013, 1:28 pm
Location: Barbados

CSPro closes after entering a case

Post by Don »

I created an app that persons can complete their listings (Control Sheets) on the computer. They can then upload to the FTP server then download to a tablet. I set it up to continuously add cases and go back to the menu app when it is stopped.

However, when they complete a case and click accept, the entire application closes and the user has to start the menu app again to add another case. I attached my packed application, is there any way to fix this?
Attachments
CLFSS.zip
(76.68 KiB) Downloaded 239 times
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: CSPro closes after entering a case

Post by Gregory Martin »

Your file Listing.pff has this:

Parameter=onexit=../Menu/Menu.pff

Remove the Parameter= part. It should look like this:

OnExit=../Menu/Menu.pff
Don
Posts: 55
Joined: February 15th, 2013, 1:28 pm
Location: Barbados

Re: CSPro closes after entering a case

Post by Don »

Thanks that stopped the entire application from closing after accepting the case. Now the secondary problem is that users want to enter multiple cases without having to go back to the menu.

I added the line filewrite(pffFile,"AutoAdd=Yes"); in the launchControlSheet() function in the menu app but that doesn't seem to do anything.
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: CSPro closes after entering a case

Post by Gregory Martin »

Are you working on Android or Windows? On Android, the AutoAdd flag is ignored. However, if on Windows, make sure that AutoAdd is in the [DataEntryInit] section.

http://www.csprousers.org/help/CSPro/ru ... entry.html

If it is and you still have a problem, can you post your PFF?
Don
Posts: 55
Joined: February 15th, 2013, 1:28 pm
Location: Barbados

Re: CSPro closes after entering a case

Post by Don »

This is on Windows. This is the code used to generate the pff file. I also attached the resulting pff file as a txt file.

Code: Select all

//Launches the Control sheet
function LaunchControlSheet()
	//execpff("../ControlSheets/Listing.pff", stop);
	string pffFilename = Pathname(application) + "../ControlSheets/Listing.pff";
	setfile(pffFile,pffFilename,create);

	filewrite(pffFile,"[Run Information]");
	filewrite(pffFile,"Version=CSPro 7.1");
	filewrite(pffFile,"AppType=Entry");
	filewrite(pffFile,"Description=CLFSS Control Sheet");

	filewrite(pffFile,"[DataEntryInit]");
	filewrite(pffFile,"OperatorID=%s",UNAME);
	filewrite(pffFile,"StartMode=Add");
	filewrite(pffFile,"ShowInApplicationListing=Hidden");
	filewrite(pffFile,"Lock=CaseListing");
	filewrite(pffFile,"AutoAdd=Yes");

	filewrite(pffFile,"[Files]");
	filewrite(pffFile,"Application=%s","./Listing.ent");
	filewrite(pffFile,"InputData=%s","../Data/Controlsheet.csdb|CSPRODB");
	filewrite(pffFile,"Paradata=%s","../Data/Controlsheet.cslog");
	
	filewrite(pffFile,"[UserFiles]");
	filewrite(pffFile,"PFFFILE=%s","");

	filewrite(pffFile,"[Parameters]");
	filewrite(pffFile,"OnExit=../Menu/Menu.pff");
	filewrite(pffFile,"MODE=DEFAULT");
	filewrite(pffFile,"LSTENUMCODE=%s",maketext("%v",visualvalue(USERID)));
	filewrite(pffFile,"LSTED=%s",maketext("%v",ME_ED));
		
	close(pffFile);
	
	execpff(filename(pffFile), stop);
end;
Attachments
Listing.txt
(439 Bytes) Downloaded 210 times
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: CSPro closes after entering a case

Post by Gregory Martin »

The problem is the line Lock=CaseListing, which is basically incompatible with the AutoAdd=Yes line. With the Lock=CaseListing line, CSEntry will quit immediately after entering one case. If you remove that line, it will work.

If you want to continuously add cases but don't want the user seeing the case listing, unfortunately, at the moment, there is no way to achieve that.
Don
Posts: 55
Joined: February 15th, 2013, 1:28 pm
Location: Barbados

Re: CSPro closes after entering a case

Post by Don »

Ok understood. I will find a workaround using getOS() in my menu app since the lock caselisting thing is mainly for Android.
Don
Posts: 55
Joined: February 15th, 2013, 1:28 pm
Location: Barbados

Re: CSPro closes after entering a case

Post by Don »

Ok I modified the PFF file to the following:

Code: Select all

function LaunchControlSheet()
	//execpff("../ControlSheets/Listing.pff", stop);
	string pffFilename = Pathname(application) + "../ControlSheets/Listing.pff";
	setfile(pffFile,pffFilename,create);

	filewrite(pffFile,"[Run Information]");
	filewrite(pffFile,"Version=CSPro 7.1");
	filewrite(pffFile,"AppType=Entry");
	filewrite(pffFile,"Description=CLFSS Control Sheet");

	filewrite(pffFile,"[DataEntryInit]");
	filewrite(pffFile,"OperatorID=%s",UNAME);
	filewrite(pffFile,"StartMode=Add");
	filewrite(pffFile,"ShowInApplicationListing=Hidden");
	if getos() = 20 then				//only include the following line if on an android tablet
		filewrite(pffFile,"Lock=CaseListing");
	endif;
	filewrite(pffFile,"AutoAdd=Yes");

	filewrite(pffFile,"[Files]");
	filewrite(pffFile,"Application=%s","./Listing.ent");
	filewrite(pffFile,"InputData=%s","../Data/Controlsheet.csdb|CSPRODB");
	filewrite(pffFile,"Paradata=%s","../Data/Controlsheet.cslog");
	
	filewrite(pffFile,"[UserFiles]");
	filewrite(pffFile,"PFFFILE=%s","");

	filewrite(pffFile,"[Parameters]");
	filewrite(pffFile,"OnExit=../Menu/Menu.pff");
	filewrite(pffFile,"MODE=DEFAULT");
	filewrite(pffFile,"LSTENUMCODE=%s",maketext("%v",visualvalue(USERID)));
	filewrite(pffFile,"LSTED=%s",maketext("%v",ME_ED));
		
	close(pffFile);
	
	execpff(filename(pffFile), stop);
end;
It is more important to have the case listing locked on the tablet than on windows. It is also more important to auto add on windows. Therefore I'll lock the case listing only on android tablets.
Post Reply