Remove inaccessible fields from sObjects before DML operations — March 13, 2024

Remove inaccessible fields from sObjects before DML operations

Hi Techies!

In this article, we will look into the following scenario.

Let’s say User X is trying to insert an Account record via Apex, but there is a Rating field on the Account object to which the user doesn’t have access. The user can still create an Account record, but we have to make sure the Rating field is not set and it doesn’t throw an exception in this scenario.

How to achieve this?

Continue reading