I'm trying to set a user's prefix programmatically and this error pops up.

I'm running the report as a user who is  "system user" therefore permissions shouldn't be a problem

When I try executing the method manually using the Debug "immediate" window, the behaviour is the following:

The first call fails, the second (and further) call(s) succeed. Apparently, the prefix is set. However, when checking the prefixes (Database > Properties > Identifiers), no prefix is  ever created. Even after loggin out / logging in again on the database the list contains only the default "STD" prefix.

What am I missing here? Do the User object needs to be "saved" or "commited" in some way before setting the prefix?

Any ideas?

Thanks in advance!

Tags: script Report