public without sharing class AssetworkflowHandler extends Oly_TriggerHandler { private Map newMap; private Map oldMap; private List newList; private List oldList; public AssetworkflowHandler() { this.newMap = (Map) Trigger.newMap; this.oldMap = (Map) Trigger.oldMap; this.newList = (List) Trigger.new; this.oldList = (List) Trigger.old; } protected override void beforeInsert() { workflowCodeadd(); } protected override void beforeUpdate() { workflowCodeadd(); } // 202030920 gzw NFM110优化改造 private void workflowCodeadd() { for(Asset nObj : newList) { //新逻辑保修期限对应 if(nObj.New_logic_data__c) { nObj.Guarantee_period_for_products__c = nObj.Guarantee_period_formula__c; } } } }