64
Views
7
Comments
Checkbox in list
Question

Hi, 
     I have a new request and then when it  saves comes back to the Home where it contains all the created request , When I click on its request id it goes to that particular request screen. Here I have a list of users I need to select and save its username, userid , requestid, chkbox in a Checkbox Entity. Again when I come back to this request I need to see all the checkbox that is selected.
I am unable to select individual checkback and when save in Checkbox Entity I tried to see whether for that requestid that is selected by checking its chkbox column, but I couldn't achieve this functionality.
Attaching oml file for the reference.

Thanks
Annie

CheckBox.oml
2023-09-28 14-21-55
Daryna Kravets

Hi Annie,

It looks like the variables in the checkboxes are not connected properly to the list values. Can you share your OML to check what exactly is wrong?

UserImage.jpg
Annie Bibiana Yesudass

@Daryna Kravets ,
     Please find the oml file attached above.
Thank you, 
Annie

2023-09-28 14-21-55
Daryna Kravets

You're using GetUsersWithUserRoles.List in the list, but GetCheckboxById.List for the checkboxes. The second list doesn't iterate, so it always displays the first row. 

You need to fetch all the data for the list in one aggregate. 

Also, checking user's roles by the hardcoded RoleId will lead to errors. Use this list instead: 

Please check the edited OML attached. 

CheckBox.oml
UserImage.jpg
Annie Bibiana Yesudass

Hi @Daryna Kravets,
Thank you for oml file, now the list of users is not showing. 

2023-09-28 14-21-55
Daryna Kravets
CheckBox.oml
UserImage.jpg
Annie Bibiana Yesudass

Hi @Daryna Kravets ,
                             I have changed aggregate. Since initially I have saved the request in Request Entity only after the OnClick of the checkbox , save button all the checkbox details would be saved in the Checkbox Entity. So initially its requestid would be not available, So I have considered Request Entity's request Id but it shows no records found. 
How can I get rolw based requestId for that?

CheckBoxUpdated.oml
2023-09-28 14-21-55
Daryna Kravets

Hi Annie,

1. Your last version of the aggregate will never show users without a connected Checkbox record because you changed their join to Only With. 

2. The change for RequestId makes no sense. You're still filtering by RequestId input parameter, but have an extra step. Also, when you have a filter for Request, the With or Without join between Checkbox and Request effectively becomes Only With. 

Checkbox entity has a foreigh key attribute RequestId, so the corresponding record in Request entity has to be created first. 


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