Hello. Need help adding donations to a total to each person. I am having trouble figuring this out?

0
I would like to add I am very new to mendix. I want to make it so that I can add a donation number to this box and press donate. This pops up fine and lets me press donate with an amount and even has a thank you message. My issue is that after I press donate, my number isn't added to the text box I want. I also want this number to add up over time as there are more donations made.   The picture below is where it should show. I just have a text box with the parameter of the attribute. I will also add my entities and microflow below for extra details.
asked
1 answers
1

Hi Alessandro Belli,

 

I would like to share the proper approach on this:

1.In Patient, change Donation (String)TotalDonated (Decimal, default 0).

On the popup’s Donate button, call a microflow ACT_SaveDonation:

  1. Validate $Donation/Amount > 0.

  2. Set association: Change $Donation/Donation_Patient = $Patient.

  3. Commit $Donation.

  4. Change object $Patient/TotalDonated = (if empty($Patient/TotalDonated) then 0 else $Patient/TotalDonated) + $Donation/Amount, Refresh in client = Yes.

  5. Commit $Patient .

  6. Close page (refresh caller, if available).

Try this method, It will help you !!

answered