salesforce-development
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSalesforce Development
Salesforce开发
Patterns
模式
Lightning Web Component with Wire Service
使用Wire Service的Lightning Web Component
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.
使用@wire装饰器实现与Lightning Data Service或Apex方法的响应式数据绑定。@wire适配LWC的响应式架构,可实现Salesforce性能优化。
Bulkified Apex Trigger with Handler Pattern
采用处理器模式的批量Apex触发器
Apex triggers must be bulkified to handle 200+ records per transaction.
Use handler pattern for separation of concerns, testability, and
recursion prevention.
Apex触发器必须支持批量处理,以应对每笔事务200条以上的记录。使用处理器模式实现关注点分离、可测试性和递归预防。
Queueable Apex for Async Processing
用于异步处理的Queueable Apex
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.
使用Queueable Apex进行异步处理,支持非基本类型、通过AsyncApexJob监控以及任务链。限制:每笔事务最多50个任务,任务链时最多1个子任务。
Anti-Patterns
反模式
❌ SOQL Inside Loops
❌ 循环内执行SOQL
❌ DML Inside Loops
❌ 循环内执行DML
❌ Hardcoding IDs
❌ 硬编码ID
⚠️ 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 |
| 问题 | 严重程度 | 解决方案 |
|---|---|---|
| 问题 | 严重 | 查看文档 |
| 问题 | 高 | 查看文档 |
| 问题 | 中 | 查看文档 |
| 问题 | 高 | 查看文档 |
| 问题 | 严重 | 查看文档 |
| 问题 | 高 | 查看文档 |
| 问题 | 高 | 查看文档 |
| 问题 | 严重 | 查看文档 |