Table Record with Checkbox

Table Record with Checkbox

  

Hi,

I have a table record with all the projects that exist, and I want to select in the checkbox the ones that are active for the user of the combobox. I have in the table record an aggregate with the entities project and projectuser and a filter with the projects of that person and for that only it shows me in table record the user projects that I choose and not all. Someone can help me?

Thanks


Ps - in the image is what I want.

Hi Rui,


You can add a New Attribute to your aggregate where you define a Boolean expression that verifies if the Project is from the selected user. You can then map a checkbox to the new attribute of your table record.

Don't forget tu refresh your table records when you select a new value in the combo box.



Cheers,

Tiago.

Tiago Gafeira wrote:

Hi Rui,


You can add a New Attribute to your aggregate where you define a Boolean expression that verifies if the Project is from the selected user. You can then map a checkbox to the new attribute of your table record.

Don't forget tu refresh your table records when you select a new value in the combo box.



Cheers,

Tiago.


I split the aggregate in two and created a new attribute in the projects aggregate, and in the attribute I put the following condition:

If (Project.Id = GetProjectUsersByUserId.List.Current.Project_User.ProjectId, GetProjectUsersByUserId.List.Current.Project_User.IsActive, False)

But still something is wrong.

Solution

Hi Rui,

I'll ignore your answer to Tiago as I don't undertand it and respond to your first question. You have a filter that causes only projects to be selected that are for the selected user. I assume you have a link table between project and user since it's an n:n reationship? What you need to do is make that a left join ("With or Without" in the Aggregate), and move the condition from the Filter to the join. Thus you select all projects, and optionally the current user if they're assigned to it.

As Tiago mentioned, you can then add a new Attribute to the Aggregate (you can click the "(+) New Attribute" column header) with a Formula that returns True when Person is selected and False when they're not (check e.g. for NullIdentifier() on the Person.Id or the like). This Attribute can then be used in your Table Records.

When the user Saves the content of the Table Records, you can check the Attribute above for each record, and save the relation accordingly. Note that if the checkbox is disabled, you need to remove the link if it wasn't disabled before, and if it is enabled, you need to add the link if it was disabled.

Solution

You can have only one aggregate.

AssignedToUser has a formula that will allow you to show/hide the list checkbox

UserId is the variable that holds the id of the user selected in the combo box.


Selected will hold the value of the list checkbox.


TableRecords would look like



Hope this helps.


Thanks for all answers. The problem is solve.