Skip to main content
Hardcoded IDs in code

Detect any hardcoded record IDs in your Lightning controllers and Apex classes and triggers.

Lorenzo Frattini avatar
Written by Lorenzo Frattini
Updated over a week ago

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?