Debug Salesforce Field Update

Background

In existing big projects, when working with fields in lower environments, everything goes well in your sandbox. When the code is deployed to higher environments for testing, you notice it is not working as expected and the root cause is that an existing field is not updating. In a large code base, there are a lot of processes that can impact that one field. We can use the following steps to identify the root cause.

In this example, we are using a custom field Region__c on the Case object.

Solution

  1. Go to Setup -> Object Manager
  2. Search for “Case” in the Object Manager “Quick Find” search box
  3. Go to Case -> Fields & Relationships
  4. Search for “Region” (or your field name) in the Case “Quick Find” search box
  5. Click on the “Where is this used?” button

You will now see a list of places where the field is referenced.

Where is this used example.

We can see a flow using the field. The next step is to open and check any process that should be updating the field but is failing. Our flow is inactive when we open it.

Inactive flow.

To fix the issue, we activate the flow and check if the field is updating and our code is working properly.

Conclusion

In large environments, this technique can be useful to identify for root causes that are impacting a specific field.




Photo used in social media banner by Solen Feyissa on Unsplash