My actual object is to create a block that can permit one End-user to create an N number of emails and send that N number of emails at the same time.
I'm trying to do it in this specific way:First, I create a structure for the email, which has two attributes: an Entity identifier for an entity that should have the destination email, and another attribute to hold the email text.Second, I create a block with a list of the sendEmails, the structure of which I discussed before.
In each list item, there is a form with a dropdown of the entity who has the email and a textAreabelow of this list is a link that executes a client action to increment the SendEmails List in one sendEmail for click,Now my question is: how can I use a button below all these widgets, the list with the forms in each list item, and the icon(link) to increment the number sendEmails, to validate all the forms, and trigger my server action to send the email?
I don't know if I understood your question correctly, but here we go...
First you need to have a local list with the structure that will receive the agency data and the text you want to send the email to:
So, as you will always display the screen containing at least one record in this list, you could, for example, use the OnInitialize event to fill this first record:
After that, on the add new agencies button, you simply append records to this list as the user clicks the button:
In the widget tree, the example structure looked like this (notice that the list containing the inputs are inside the form, this will be essential for us to be able to validate the fields):
In the Sent button properties, we will set the "Built-in validations" property to True and also set the "Mandatory" properties for the form fields to True:
Finally, we will validate the mandatory fields in the "SendOnClick" client action:
And the result will be:
You can check a working example through the following link:
Send Mail Sample
I hope this is what you are looking for.
The Solutions Works, thanks for the help
You marked your own comment as a solution. Please mark the answer above correctly so that others can be helped.