Says that the client doesn’t have access, even though I wrote it in the sever code!!
Please someone help me, I have a project due very soon and this button is the only thing that’s not working.
My code is in the replies.
Thanks.
anvil.server.InternalError: Permission denied: Cannot write in table from client code. ![anvil SM error|690x172]
The error message suggests that the code you’ve displayed isn’t where the error is occurring.
It looks like you have a writeback databinding for the drop down selected value property. Since the self.item is a table row you can’t edit it with view only permissions. When someone tries to change the drop down item you will get this error.
There are two options you might explore.
Depending on the data table sensitivity, you can change the permissions to client side writable.
Alternatively, and probably better, self.item shouldn’t be the table row but a dictionary of the table row self.item=dict(table_row)
This way you are not trying to update the table row on the client with the databindings but instead updating a dictionary. You can then update the table row on the server with similar code to the above.
The news aggregator tutorial follows the latter protocol when making edits on the client side and would be worth looking at if you haven’t already.