How to remove entity record using a specific index?

So what I wam trying to do is very simple. I want to delete some people in my person entity at specific indexes, 15, 16, 17, 18, 19. I am using the deletePerson action to do that, or trying to anyways. It asks me to specify the Id of the person I want. So what I want to know is what is the syntax to do that, the GetPerson() doesn't work, same problem. In a different IDE it would be something like DeletePerson(Person[15].Id), how do I write that in OutSystems?

Hi Felipe,


You can use this sintax:

YourTableRecordOrList.List[YourIndex].Table.Attribute

e.g.:

MenuTableRecord.List[15].Clients.Id


Regards

Solution

With indexes you mean Their Id?


Then its very simple indeed:

DeletePerson(integertoidentifier(15))

should do the trick.


Solution

Hi Felipe,

you can use like-

DeletePerson(Person.List.current.PersonTable.id)

Or

DeletePerson(Person.List[Index].PersonTable.id)


Kind Regard

Rahul Sahu

Stefano Valente wrote:

With indexes you mean Their Id?


Then its very simple indeed:

DeletePerson(integertoidentifier(15))

should do the trick.


Thanks! This one is exactly what I was looking for, I am a bit surprised you don't need to specifywhich entity identifier should be returned, I suppose the deletePerson Action takes care of that, but it works so I am happy =].


Felipe, In OS every entity has an Id which is the key of the record. This way its easy to use it when you need to access the record or, in your case delete it.

Have fun developing ;)