Tuesday, May 17, 2016

Developer: DML operations not allowed on user...

Trying to build a VF page to load Accounts, Contacts and User.

While I could use the Upsert operation on Account and Contacts, User object would not allow me to use User.

"DML operation not allowed on User" was the error throw while trying to save the class.

Solutions

I worked around this by adding an operation flag to a file and creating 2 list one for insert
and one for update.

I then would check the value in the flag and then based on whether it is Insert or Update
add the record to the appropriate list and then do a bulk operation.

No comments:

Post a Comment