Reopening a closed case

Hello all -- Please consider this situation. I have some suspicions of
steps that we could take, but I wanted to check with the wise people.

-- We want to use the "edit forms" feature to go back and add a certain
code into a field in several of our past forms. We know the "edit forms"
feature will do the job.

-- However, this time, when we tried to edit the form, CommCare said that
because the form's case had been closed, it was not able to edit that form
until it was re-opened.

-- The question: What is the simplest and most graceful way to re-open that
case?

  • I do know that one method is to find the form that had resulted in
    that case being closed, and archive that form... then the case will spring
    back to life. (That would indeed be the form that we wanted to edit one
    field on.) But that archiving of the whole form method feels somewhat
    complex as we would have to then complete the whole form again.
  • Is there some other more direct way of quickly re-opening that form,
    so we can then do that one-field form edit, and then re-close it? We
    didn't see any handy "re-open this case" buttons anywhere on the UI when we
    looked.

Just wanted to make sure we were doing things the smart way.

Thanks

Eric

Hey Eric,

I think the recommended workflow would be to archive the form, edit the
previous form, then "unarchive" (restore) the form so that the case is
re-closed with the same information.

Cory

··· On Thu, Mar 2, 2017 at 7:46 AM, Eric Stephan wrote:

Hello all -- Please consider this situation. I have some suspicions of
steps that we could take, but I wanted to check with the wise people.

-- We want to use the "edit forms" feature to go back and add a certain
code into a field in several of our past forms. We know the "edit forms"
feature will do the job.

-- However, this time, when we tried to edit the form, CommCare said that
because the form's case had been closed, it was not able to edit that form
until it was re-opened.

-- The question: What is the simplest and most graceful way to re-open
that case?

  • I do know that one method is to find the form that had resulted in
    that case being closed, and archive that form... then the case will spring
    back to life. (That would indeed be the form that we wanted to edit one
    field on.) But that archiving of the whole form method feels somewhat
    complex as we would have to then complete the whole form again.
  • Is there some other more direct way of quickly re-opening that form,
    so we can then do that one-field form edit, and then re-close it? We
    didn't see any handy "re-open this case" buttons anywhere on the UI when we
    looked.

Just wanted to make sure we were doing things the smart way.

Thanks

Eric

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Cory -- your reply was great... but made me realize I need to explain
more about this situation.

In our normal app use,

1-- We have our A1 form, which has a field that collects a certain coupon
number. at the end of that form, it opens a child case called 'referral'
and passes the coupon number to that child case.

2-- Then, the C1 form requires that new 'referral' case... it opens the
case and it loads that coupon number into a hidden value. At the end of the
C1 form, it closes that case.

3-- Our sad situation is that a staff member forgot to enter the coupon
numbers into a lot of their A1 forms. The result was that it created those
referral child cases with no coupon numbers... and then, the staff filled
out the C1 form which of course did not get that coupon number loaded into
its hidden value.

4-- When we started to remedy this problem, we thought "OK, we will simply
use Edit Forms on all the A1 forms and also on the C1 forms, to manually
plug the correct coupon numbers into each form. We actually started on
all that and did the form edit on all the A1s. (Maybe that was
premature.) Only then did we realize "oh, we can't edit the C1 forms when
the case is closed.

So my questions are:

(A) Is it possible, when using Edit Form, to actually edit a hidden value
field? (in other words, to edit the hidden value that should originally
have been loaded into from the case)? Possible or impossible?

(B) If that is impossible, I am trying to figure the best process to get
those correct coupon numbers both in the A1 and the C1... Maybe you know
the best path, but would this method work:

  • First archive the existing bad C1 form, and therefore its case is
    re-opened
  • Only then edit the A1 form -- and magically when I do that edit,
    commcare will see the new coupon number and realize that it needs to pass
    that coupon value into the child case... BUT, in this scenario, that child
    case is not being created, it's already there... so I figure it's more
    likely that it would create a second child case instead (if it does
    anything at all) (Soooo, this method does not look very likely to work...)
  • If that above did indeed work, then we would go and simply open the C1
    form, choose the desired case which nicely has the coupon number in it...
    C1 would load that coupon number in to it, and we would complete C1 and it
    would have the correct coupon number in it.

I suspect that the above suggestion is an impossible dream... So, do you
recommend the best way of handling the correction of the coupon number both
in A1 and in the child-case-requiring C1 form?

Thanks... sorry for the headache... this has been a heck of a day!

Eric

Hi Eric,

Responses inline:

(A) Is it possible, when using Edit Form, to actually edit a hidden
value
field? (in other words, to edit the hidden value that should
originally have been loaded into from the case)? Possible or impossible?

Generally, impossible - you are only able to change the values that would
be affected by inputs. In this case the case property would likely have
been loaded when you initially opened the form, and editing the form would
not cause this value to reload.

(B) If that is impossible, I am trying to figure the best process to get
those correct coupon numbers both in the A1 and the C1... Maybe you know
the best path, but would this method work:

  • First archive the existing bad C1 form, and therefore its case is
    re-opened
  • Only then edit the A1 form -- and magically when I do that edit,
    commcare will see the new coupon number and realize that it needs to pass
    that coupon value into the child case... BUT, in this scenario, that child
    case is not being created, it's already there... so I figure it's more
    likely that it would create a second child case instead (if it does
    anything at all) (Soooo, this method does not look very likely to work...)
  • If that above did indeed work, then we would go and simply open the
    C1 form, choose the desired case which nicely has the coupon number in
    it... C1 would load that coupon number in to it, and we would complete C1
    and it would have the correct coupon number in it.

I suspect that the above suggestion is an impossible dream... So, do you
recommend the best way of handling the correction of the coupon number both
in A1 and in the child-case-requiring C1 form?

I'm not certain, but I believe that if you archive C1 and then edit A1 the
existing case will be successfully updated with the new value - as though
you had created the case with this value in the first place. This is at
least worth trying out.

Unfortunately, Edit Forms' behavior can be very brittle/unspecified with
forms involving case transactions (for reasons that I think you've
detected/touched upon as you reasoned about how to approach this problem).
Having a form that allows you to edit the coupon values of 'C1' cases might
be the more sustainable/robust solution.

Cheers,
Will

··· On Fri, Mar 3, 2017 at 10:14 AM, Eric Stephan wrote:

Hi William --

Ah ha... your suggestion that we create a kind of new "utility" form to
edit the C1 case is an eye-opener. We will probably do that.

It doesn't make our situation easy, but it's easier than the worst-case
scenario we were worrying about (re-creating a ton of A1 forms.)

It is funny that when you have a "bad data" situation pop up, you forget
the array of tools that you can draw on to remedy the situation. Makes me
want to make some kind of flowchart to remind me of the possible avenues.

Thanks!

Eric