技能 编程开发 Salesforce 开发最佳实践

Salesforce 开发最佳实践

v20260317
salesforce-development
指导 Salesforce 开发者使用 @wire 装饰器实现 Lightning Data Service 或 Apex 方法的响应式绑定,采用 Handler 模式编写批量化触发器,使用 Queueable Apex 进行异步作业,并避免 SOQL/DML 循环和硬编码 ID。
获取技能
229 次下载
概览

Salesforce Development

Patterns

Lightning Web Component with Wire Service

Use @wire decorator for reactive data binding with Lightning Data Service or Apex methods. @wire fits LWC's reactive architecture and enables Salesforce performance optimizations.

Bulkified Apex Trigger with Handler Pattern

Apex triggers must be bulkified to handle 200+ records per transaction. Use handler pattern for separation of concerns, testability, and recursion prevention.

Queueable Apex for Async Processing

Use Queueable Apex for async processing with support for non-primitive types, monitoring via AsyncApexJob, and job chaining. Limit: 50 jobs per transaction, 1 child job when chaining.

Anti-Patterns

❌ SOQL Inside Loops

❌ DML Inside Loops

❌ Hardcoding IDs

⚠️ Sharp Edges

Issue Severity Solution
Issue critical See docs
Issue high See docs
Issue medium See docs
Issue high See docs
Issue critical See docs
Issue high See docs
Issue high See docs
Issue critical See docs

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

信息
Category 编程开发
Name salesforce-development
版本 v20260317
大小 1.51KB
更新时间 2026-03-21
语言