Page 1 of 1

Lost prefilled data while entry in CAPI android

Posted: April 22nd, 2019, 12:38 pm
by liennhu
Dear CsPro users,

I have prefill logics to fill Plot ID and other information from the previous roster to the following. The prefill working well but I am really struggling during the data entry while the Plot ID prefilled with logics keeps disappearing whenever I reach the next var in roster (the "Power" variable in "Land preparation" roster").

Please kindly find the attached file for the example. Thank you very much for your kind support so far and forward!

Best regards,
Lien

Re: Lost prefilled data while entry in CAPI android - Plot ID turned into 0 or missing :(

Posted: April 22nd, 2019, 10:52 pm
by liennhu
Hello CSPro users, I am sorry that the previous file couldnt run for extra logics. I added the new example for your reference. I am looking forward to your response and disscusion.

Re: Lost prefilled data while entry in CAPI android

Posted: April 23rd, 2019, 10:49 am
by Gregory Martin
Your application couldn't be loaded because you didn't include this dictionary:

..\Data\Wave 1 to lookup\Copy of Lookup dict.dcf

Can you include this and then give us instructions on how to recreate your problem?

Re: Lost prefilled data while entry in CAPI android

Posted: April 24th, 2019, 5:04 am
by liennhu
Gregory Martin wrote:Your application couldn't be loaded because you didn't include this dictionary:

..\Data\Wave 1 to lookup\Copy of Lookup dict.dcf

Can you include this and then give us instructions on how to recreate your problem?
Hi Martin,

I added "Lookup dict.dcf" and "Part D and E.csdb" for loading the look-up data into the application.

For the problem that i am facing now, I added three pictures, alll packed in .zip file,2 of which were seperately added as attachments here.

Another relevant detail: I created the logics to auto fill the W2_E1 - Plot code, in Roster PART2_E1000 - HT land preparation. It basically to fill the plot code when the plot is grown with either "Rice" or "Rice with Aquaculture" in W2_D8A_19 - HT 2018 season crop, Roster PART2_D1B000 - Rice plot Part 2.

Problem happens when we enter from 2 plots, let's enter number of plots so that "W2_D0_2 + W2_D0" >= 2. Then the second plot code in W2_E1, even though filled previously when we are at W2_E1, will disppear when I moved to Land preparation Power, eg. And the plot code field W2_E1 will not show up in Data viewer also.

Please let me know if anything unclear.

Thank you very much for your kind support

Best
Lien

Re: Lost prefilled data while entry in CAPI android

Posted: April 26th, 2019, 11:22 am
by Gregory Martin
Can you figure out exactly when the plot code is being changed to blank? You have this code over and over in the PART2_E1000 roster:
W2_E1(curocc(PART2_E1000))=E1(curocc(PART2_E1000));
Is there a reason that you need to keep filling this code in, rather than just filling it once in PROC W2_E1?

Also, you can make your code much more readable by getting rid of a lot of the curocc(PART2_E1000) references. When you're on that roster, you can just call curocc without an argument. For example:
if curocc(PART2_E1000) <= (i)
   
and W2_D8A_19(curocc(PART2_E1000)) <> 1 and W2_D8A_19(curocc(PART2_E1000)) <> 2
   
then  $(curocc(PART2_E1000)) =0;
    {noinput;}
   
skip to next;
endif;
You can change that to:
if curocc() <= (i)
   
and W2_D8A_19(curocc()) <> 1 and W2_D8A_19(curocc()) <> 2
   
then  $ = 0;
    {noinput;}
   
skip to next;
endif;