Rationale

Record IDs change between environments, so any logic using IDs that are hardcoded in the code will fail when deployed to a different sandbox or Salesforce org.  

Scope

  • Apex classes and triggers
  • Lightning component controllers (JavaScript)

See also

Did this answer your question?