I created this custom role-permission in outsystem because we are required to do so and not to use the built-in in the outsystem. While Creating the custom made role permission, I have encounter some problem in getting the data from the source block especially in the toggle button. Since I'm triggering the event on onchange event of the toggle some of the data is duplicated if I on/off multiple time the toggle. The PermissionLevelSet is the action handling the event, other than listappend what can I use to get the list of the Permission Level and the corresponding boolean in the toggle, I also attached the OML file if my question is bit confusing.
Hi Romeo Sandrino, you can always validate if the permission exists in the list, which means if the index is equal to -1, you append it; otherwise, you modify the value of the element at the position returned by ListIndexOf. Remember that you need to filter by Id = PermissionLevel.Id, so you either edit the value or add it.
Hi Thanks, I already solve my problem.
Hi!
You must verify if the PermissionLevel record already exists in the table and if it exists update it or remove it prior to add the new.
Widgets to use in the last case
Listindexof - to find the position of the permission
ListRemove - to remove the permission prior to add the new one
Hope this helps
Graça
Hi Romeo
I have checked your OML. am not understanding why you are using the list inside the web block and the data from which list is binded is a static entity.