This is somewhat related to a past question of mine: Automated Process User and AccessLevel.UserMode - Should It Lose Access?.
As per that question, when Apex executes as the Automated Process user and user mode is enforced, either through WITH USER_MODE
in SOQL, or using insert as user blah
notication, it loses access to a lot of fields. But not all fields it seems.
For example on person account it can see both FirstName and LastName, but not Industry. On User all standard fields I've tried are accessible but custom ones are not.
Is there a way to know which fields are or are not accessible? I need to ensure our code is using WITH USER_MODE
where possible, but I also need to make excpetions for areas where it's running as the Automated Process user so that it doesn't lose access to fields needed by the running code.