From construction
Question
Application Type
Reactive

Hi All,

new to Outsystems and trying to build a Golf Scoring app for a Golf Society comp.  i want to be able to create Tee positions for all 16 golfers (i have this one sorted) for each of the 5 days and then enter scores for each golfer in the same form.  i dragged my Db entities to the mainflow to create the list page and  data page entry.  the list page is fine and shows all golfers and Tee positions for the day but when i click to add scores, the form only brings back fields to enter data for one golfer, i would like to enter scores for all golfers for that day in one page.  

thanks in advance :-)

Hi @Jolly Boys,

I made a quick (and smaller) data model just for this example, don't assume it's better than what you already have (I'm still learning as well!)

I have the TournamentPlayers relation entity and we can select which players will play that tournament:

Let's use the Sixth Tournament that has all 4 players in it:

From the Tournament List we can go directly to a screen to add Round 1 scores to all players:

Important note: After setting the players and "starting"  the tournament, we can create the HCP and Round1  (2, 3...5) relations with empty values. So we would see something like this:

Maybe the date or other inputs would be the same for all (not sure about how each round is played), but you can see we could fill each player's Round 1 details for this specific Tournament. We would have different screens for Round 2, 3...5. Again, there could be a better approach for 'n' rounds. But let's leave it for now...

For Round 1 inputs, we could have a screen with this Aggregate:

Since in this screen we only want data for Round 1, we need to assure that in the join:


Then we can have a list of form's: 

The container below the list can be 4 col's width and have some padding. Also use "overflow: auto;" in the list widget if you can't see more items or scroll in the screen.

The save action will need to cycle through that list to Create Or Update HCP and Rounds. Just remember not to do it in Client actions since it will call several server actions (group them all in a single server action).

 After saving some random values, we should see them in the Hcp List screen:

And in the Round List screen:


Please let me know if this helped you in any way!

Thanks,

Fábio

Is the Hcp entity the relation between Players and Tournament? If not, you should have that relation entity.

If it is, in the Add Scores page you need to get a Distinct list of players for that Tournament and in the screen instead of one form, you will have a list of forms (with the source of that list being that distinct list of players).  Then I believe in the Save Action using a ForEach cycle you can run that list and do a CreateOrUpdate for every record.

Please let me know if it made sense and if it helped in any way!

Thanks,

Fábio

Hi Fabio,

yes, that makes sense, i will have a go at implementing your suggestion.

thanks

Hello again Fabio,

i have a distinct list and multiple forms but dont understand how to bind form2  "Firstname" input field to the second value in the distinct list.

what iam getting is two forms with the same values that actually happen to be the first value in the distinct list

ant help appreciated :-)

Hi @Jolly Boys,

I made a quick (and smaller) data model just for this example, don't assume it's better than what you already have (I'm still learning as well!)

I have the TournamentPlayers relation entity and we can select which players will play that tournament:

Let's use the Sixth Tournament that has all 4 players in it:

From the Tournament List we can go directly to a screen to add Round 1 scores to all players:

Important note: After setting the players and "starting"  the tournament, we can create the HCP and Round1  (2, 3...5) relations with empty values. So we would see something like this:

Maybe the date or other inputs would be the same for all (not sure about how each round is played), but you can see we could fill each player's Round 1 details for this specific Tournament. We would have different screens for Round 2, 3...5. Again, there could be a better approach for 'n' rounds. But let's leave it for now...

For Round 1 inputs, we could have a screen with this Aggregate:

Since in this screen we only want data for Round 1, we need to assure that in the join:


Then we can have a list of form's: 

The container below the list can be 4 col's width and have some padding. Also use "overflow: auto;" in the list widget if you can't see more items or scroll in the screen.

The save action will need to cycle through that list to Create Or Update HCP and Rounds. Just remember not to do it in Client actions since it will call several server actions (group them all in a single server action).

 After saving some random values, we should see them in the Hcp List screen:

And in the Round List screen:


Please let me know if this helped you in any way!

Thanks,

Fábio

Hi Fabio,

thanks.  I have got this working now, slightly different than what you did but you gave me sound foundations to make it work

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.