We have a custom object MyCustomObject__c, which contains a lookup to the user reference. When we update this object by API, we might not set the value User__c, but Salesforce seems to be defaulting it to a random user in the org (one that is apparently not even active)

Is this expected, and how are we supposed to manage it?


Salesforce, by default, only updates fields you specify. You have either a Process Builder, Flow, Workflow Rule, or Trigger that is causing this "random" update. You'll need to review your configuration to figure out what's going on, or you can try getting some debug logs from Setup > Monitoring > Debug Logs to figure out why this field is being updated.

  • Can this be related to some SOAP API ? Or can this be related to other frontend related issues? – Edmondo1984 May 29 '19 at 13:59
  • @Edmondo1984 Nope. It should be a configuration that someone set up in your org. – sfdcfox May 29 '19 at 14:06

As Sfdcfox says it's being called from somewhere, and your debug logs will help you figure out what's going on.

Additionally, you can download the metadata related to automation into your IDE and do a grep search on the field to see where it's being set. One of those methods/ flows/ etc is being called. the expression would be grep -nire "User__c"

  • the n option tells grep to return the line numbers
  • the i option tells grep to ignore the case so USER__C, uSeR__c, etc returns a match
  • the r option tells grep to recursively search the subdirectories
  • the e options tells grep to use User__c as the pattern

To learn more about grep searches checkout this link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.