public without sharing class ProductTypesHandler extends Oly_TriggerHandler { private Map newMap; private Map oldMap; private List newList; private List oldList; public ProductTypesHandler() { this.newMap = (Map) Trigger.newMap; this.oldMap = (Map) Trigger.oldMap; this.newList = (List) Trigger.new; this.oldList = (List) Trigger.old; } protected override void beforeInsert() { beforeSetValue(); } protected override void beforeUpdate() { beforeSetValue(); } private void beforeSetValue() { for (ProductTypes__c nObj : newList) { if (String.isBlank(nObj.Department_Cateogy__c) == false) { nObj.Department_Cateogy_Text__c = nObj.Department_Cateogy__c + ';'; nObj.Name2__c = nObj.Name; } } } }