Page 1 of 1

Error calling from External File

Posted: September 29th, 2020, 12:52 am
by Bhupender11
Dear CSPro Team,

I have an error while calling from external file.

I have Menu. From Menu, I call a case from external file then after collecting data from that case, If I call it again through Menu then it shows an error attached here.

Please help me to find the solution of this issue.

Re: Error calling from External File

Posted: September 29th, 2020, 8:21 am
by munirmdee1
Hi Bhupender11,

The error message you are getting its not comming from the external file you are referring, that comes from the case ID you entering, you are repeating entering the same ID which you already entered and save the case.

So I suggest you try entering a new case id in your form, you wont see that error.

Hope that will solve your problem.

Re: Error calling from External File

Posted: September 29th, 2020, 8:35 am
by josh
That error is probably because you are launching the second application with the same id-item values specified in the pff file and setting the startMode to add to instruct it to create a new case. When you do that, it tries to create a new case with the same id-items instead of reopening the existing case. Try setting the key parameter in the pff file you write out instead of setting the startMode. If you set the key, CSPro will automatically set the start mode to modify if the case already exists and will create a new case if it does not.

Re: Error calling from External File

Posted: September 29th, 2020, 12:38 pm
by Bhupender11
Can you have an example of how to write key

Re: Error calling from External File

Posted: September 29th, 2020, 1:31 pm
by josh
The help for pff object has an example: https://www.csprousers.org/help/CSPro/pff.html
In the CSPro examples directory the CAPI census, Labor Force Survey and Listing Menu with Map examples all use the key attribute.
The workshop materials also have an example https://www.csprousers.org/resources/CS ... rkshop.pdf. See page 66.

Re: Error calling from External File

Posted: September 30th, 2020, 2:10 am
by Bhupender11
Dear Josh,

I have tried key function but same error comes.

I have attached dummy application for the same.

If I call same case which is completed or partially completed first then this error comes.


please check what is the issue.

Re: Error calling from External File

Posted: September 30th, 2020, 7:47 am
by josh
The zero fill settings for the items in SAMPLE_DICT does not match the zero fill for the id-items in HH dictionary. Try setting zero-fill to "yes" for everything.

Re: Error calling from External File

Posted: September 30th, 2020, 1:10 pm
by Bhupender11
Thanks