Issues using case management for inventory

Hello Dear users,

We are working on an app that uses case management to make an inventory of
scratch cards that we sell and to track money that we collect in the field.

Here is how it works:

  • The agent registers a vendor (VM) with the Enregistrement VM form. We
    create a case property by type of card (i500: inventory of 500f cards,
    i1000: inventory of 1000f cards, i2000: inventory of 2000f cards ...)

  • The agent distributes cards to the vendor and fills in the “TA -
    Distribution de cartes” form. This form is supposed to update the mentioned
    above case properties.

To do so we:

  1. Load i500 in the hidden value "previousi500"

  2. Create a hidden value newi500 = previousi500 + number of cards that have
    been given to the vendor

  3. Load newi500 in the case property i500

= See attached screen shot “case management TA distribution”

  • The agent collects the money and fills in the “TA - Inventaire avec VM”
    form. This form updates the same case properties and works like this:
  1. We load i500 in hidden value "previousi500"

(See attached screen shot “inventaire avec vm form »)

  1. We create a hidden value newi500 = previousi500 – number of cards sold
    by the vendor

(See attached screen shot “inventaire avec vm form2 »)

  1. We load newi500 in the case property i500

(See attached screen shot « case management TA inventaire »)

Unfortunately the newi500, newi1000, etc. hidden values stay empty and
i500, i1000, etc. case properties are not updated.

Would you have an idea of what is wrong?

Thanks so much for your help,

Best

NicoIas