- ·上一篇文章:Apex - 触发器
- ·下一篇文章:Apex - Governer Limits调节器限制
Apex - 触发设计模式
oice Recordspublic static void createInvoiceRecords (List<apex_customer__c> customerList) {for (APEX_Customer__c objCustomer: customerList) {if (objCustomer.APEX_Customer_Status__c == 'Active' && trigger.oldMap.get(objCustomer.id).APEX_Customer_Status__c == 'Inactive') {//condition to check the old value and new valueAPEX_Invoice__c objInvoice = new APEX_Invoice__c();objInvoice.APEX_Status__c = 'Pending';InvoiceList.add(objInvoice);}}insert InvoiceList;//DML to insert the Invoice List in SFDC}}
Apex - 触发设计模式