I'm trying some of the new features to Apex to automatically apply User Access. I cannot get an update to work that worked from with a require "update" or "Database.update()".
Event eventToCancel = [SELECT Id, Subject,
TYPEOF Owner WHEN USER THEN LanguageLocaleKey, LocaleSidKey, TimeZoneSidKey END
FROM Event
WHERE Id=:currentRecord.Id
WITH SECURITY_ENFORCED
limit 1];
list<SObject> updateEventList = new list<SObject>{eventToCancel};
Database.update(updateEventList, true, System.AccessLevel.USER_MODE);
I think what it is complaining about is that the record may have both an Owner reference and an OwnerId. But, a simple "update updateEventList" statement works just fine.
I'm wondering if the access level user mode just doesn't have all the kinds worked out. Or, like many things in SF, what looks like a powerful feature turns out to be something you have to jump through hoops through to use.