Table operation is invalid during indexing (Error 1690)

You have attempted to perform a table operation in a user-defined function referenced with an index expression.