Skip to main content

Clayton Rules - Hardcoded IDs in code

David Martin avatar
Written by David Martin
Updated today

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)

Did this answer your question?