Hi,
Iam new to commcare and Iam facing some problems.
My app is structured as follow:
Module I
- Registration form: I register cases of type A and B
- Update form: I update cases. In this form, a case can change from A to B or vice- versa
Module II - Follow-up form for case A
- Here a chw has to visit case A twice. The first visit is immediately after registration and the second visit is after 30 days and I have a hidden value that calculates the number of days
Second_day_visit: if(format-date(date(today () + 30), “%a”) = “Sun” or format-date(date(today() + 30), “%a”) = “Sat”, date(today() + 32), date(today() + 30))
- Follow-up for case B
- Here a chw also has to visit case B twice. The first visit is immediately after registration and the second visit is after 45 days and I have a hidden value that calculates the number of days
Second_visit_date: if(format-date(date(today () + 45), “%a”) = “Sun” or format-date(date(today() + 45), “%a”) = “Sat”, date(today() + 47), date(today() + 45))
I have saved the hidden value as a case property and I have used it in the case details so that the chw can see the number of days for the second visit; until here things work well, but the problem is that when case A changes to B or vice-versa in the update form, the Second_visit_date is not cleared automatically so that it only shows days after first visit follow-up, i.e. the field second_visit_date should not still show 32 days after Case A changes to B, but it should empty the field so that it shows 45 days after registering the first visit.
I do not know if I have made myself understood. Looking for solution because Iam stuck.