Updating another Mobile Users Case Data

(Pavi K) #1


We are using Commcare to track sales, installations and after sales for our customers. So our Customer Case moves through a two divisions, Sales and Technical, each division with their own mobile workers. We measure certain results from each division, ie amount of deposits, mount of installs.

Once a sale is finished, the Sales Mobile User (eg sales1) will get a counter incremented that is saved as a user case. So sales1/count_deposits = count_deposits+1. Which is already implemented.

Then the Customer Case moves to a Technical Mobile Users(eg tech1) who completes the installation. The counter is count_installs for filling out this form. But both tech1 and sales1 counters need to increment for the user case property count_installs. I can increment this counter for tech1, as they are the mobile user filling the form out.

But how can I reference sales1 and add to their case properties, so add 1 to their count_installs property? So basically updating another mobile user case within a form?

Thanks and hope this makes sense:)

(Clayton Sims) #2


There are a couple of ways to configure the behavior you are describing.

If you are using user cases, you can use the case uploader to create cases with relationships to create a case which is assigned to tech1, but has an index to sales1’s user case. That will result in sales1’s usercase being synced to the device for tech1.

Alternatively, you can create shared cases for sets of users which behave similarly to the user case but are loaded or referenced independently