Skip to main content

While saving account and I am getting an exception mentioning "Operation failed due to fields being inaccessible on Sobject Contact, check errors on Exception or Result!" 

when taken out the list of fields that are inaccessible , It was observed that the field mention were either a Formula  or AutoNumber, Also I am Logged in as System Admin and i have accessibility of all these fields .

ANY idea how to fix this issue . I have checked both FLS and Profile level permission 

Also wanted to know if this feature is available at Global level or is still in Beta phase.

@Chris Peterson any advice here ?

답변 9개
  1. 2025년 5월 30일 오후 7:07

    Just finding this thread as I'm having the same / similar issue.  

     

    When doing DML in user mode it seems to simply behave much differently. Including relationship fields in a queried list that you then update causes a baffling issue: 

     

    List<Contact> contacts = [

    SELECT Id, Account.Name FROM Contact WHERE ID = '003E100000pQ2xdIAC'

    ];

    update as user contacts;

    this results in this error: 

    System.DmlException: Update failed. First exception on row 0 with id 003E100000pQ2xdIAC; first error: INVALID_FIELD, Cannot specify both an external ID reference Account and a salesforce id, AccountId: [] 

     

    Whereas this works just fine:

    List<Contact> contacts = [

    SELECT Id, Account.Name FROM Contact WHERE ID = '003E100000pQ2xdIAC'

    ];

    update contacts;

     

    Why would the handling of systematic read only fields (formula, autonumber, parent relationships) be different between access levels? If this means we have to strip queried lists of sobjects of all these fields to use DML with user mode, that seems like something that should be addressed. 

     

     

0/9000