Skip to main content

While working on our AppExchange product we moved all the query and DML to with USER_Mode and like Insert as user [sobject-here] . Now we are facing very strange issue of DML statement throwing unclear error.

 

"common.apex.runtime.impl.dmlwithaccess.UserModeFLSDMLExceptionWithResults: Operation failed due to fields being inaccessible on Sobject [our_Object_name], check errors on Exception or Result! 

 We are not able to find any documentation around 

UserModeFLSDMLExceptionWithResults

We double check and can confirm that we have given all the fields permission to the user as there are only 10 fields for that object. 

The exception message also does not show which field has permission missing.

 

We tried on scratch org of summer release and preview release of winter org.

One more fact : this is happening on 2 objects and 1 object is working fine .

 

@Chris Peterson any advice here ?

13 respuestas
  1. 18 oct 2023, 9:30

    @Nitish Kumar And @Shivdeep Kumar Yadav 

    I did some digging and this issue can be resolved by following steps 

     

    So this is not really a permission issue. If you making an insert call you will not face this issue but for update you will. To fix this remove all the autonumber, formula and Name field if it is auto number like {AR-00000} from the record before updating the records. 

     

    Feel free to let me know if you are getting the issue again.

    FYI @Chris Peterson

0/9000