I have a thing which has a infotable property that the user may be able to edit adding or deleting rows.
But I want some of the rows to be "read only" and not to be deleted.
In my service I'm just using a "if" condition but I am curious to know if there is another way to do it.
What is the use case?
Depending on the use case, it might be better to work with a DataTable vs. an infotable, because you will be able to use primary keys/indexes
I see. Honestly I wasn't thinking about Datatable.
That's my situation:
I want the user to be able to create a thing which indicates a structure.
The structure has a property called "TypeOfStructure" which is a list of choices; the user must be able to update this list; for this reason I was thinking about making a helper thing called TypeOfStructureThing which has a infotable property with two columns: Type (which is the type shown on the mashup) and Id.
I don't know if Data table is a better choice, but I'm quite open to advice
But the limitations will be the same on a DataTable.
Fabio, the only way to prevent this it's to wrap any Property/DataTable changes on a service made by you, there you can control editable/no editable rows.
There isn't build in row security.
Yes, it is what I'm doing.
I just hoped there was a different way because in this way I make a third column called "Editable" and then I put a "if" condition in my service.
It's not a big deal, was just a question to learn something new
What Charles mentions is correct in the sense that you will still have to use an 'if' statement to evaluate what a user can or can not edit.
But since this is a set of data that is used over and over again, I think it is better to permanently store it in a data table to serve as your 'template'
probably add a column isEditable to the fields in the datatable and go from there.
Ok, so to your opinion using a Data table is better than a infotable for my purpose.
I will consider this option; thank you very much