Update many values based on a single value?

Hello,

I build an app and i have an issue.
I have client debts and payments.
I want: when customer makes a payment i want my app to check and if it possible to pay off more than one debts.

0 10 326
10 REPLIES 10

Can you give a calculation example?

Iโ€™m thinking youโ€™re doing something like this?

Customer debts:

  1. $5
  2. $7
  3. $12

Assuming these debts are already in the priority order of getting payed off.
Say the customer makes a $15 payment, you want the debts to turn into:

  1. 0
  2. 0
  3. $9

?

Yes, exactly that.

Iโ€™ve heard of some people using recursive action groups before, but I havenโ€™t yet seen how exactly theyโ€™re implemented. I think this sounds like a good application for such a feature. @Steve @Bahbus I believe you two mentioned this some time ago, care to provide some more info?

@Steve has the sample app to demonstrate some recursion. I believe its in his public portfolio.

Can you link this. Iโ€™m not sure how to find it.

Which app is using recursion?

I believe that the above technique doesnt work.

The recursion aspect of Steveโ€™s example app will help you with your goal. Not the adding of new records. In general terms: instead of decrementing a count as in the example, on each loop apply a Price reduction to the next non-zero Debt record, and decrement the payment value, run until that payment value is 0.

Sometimes it works, but not all the time. I have grouped action,and i realized that the second action executed before the first is completed.

Top Labels in this Space