Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (HasOpportunityLineItem &&
- (ISCHANGED( Total_List_Price__c)) ||
- (ISCHANGED( Total_End_User_Price__c)) ||
- (ISCHANGED( Total_End_User_Price_Discount__c)) ||
- (ISCHANGED( Total_Standard_Price__c)) ||
- (ISCHANGED( Total_Standard_Price_Discount__c)) ||
- (ISCHANGED( Total_SPR_Price__c)) ||
- (ISCHANGED( Total_SPR_Price_Discount__c)) ||
- (ISCHANGED( Total_Price__c)) ||
- (ISCHANGED( Total_Price_Discount__c)) ||
- (ISCHANGED( Total_SPR_Margin__c)) ) && dummyCheckbox__c == True
- trigger TotalOpportunityProductTrigger on OpportunityLineItem (after insert, after update, after delete) {
- Opportunity Oppor = new Opportunity();
- LPGCalculatorSettings__c objCalSetting = LPGCalculatorSettings__c.getValues('RollupTriggerSwitch');
- if(objCalSetting.value__c){
- TotalOpportunityProductTriggerHandler tp = new TotalOpportunityProductTriggerHandler();
- if(Trigger.isInsert && Trigger.isAfter){
- tp.TotalField(Trigger.new);
- oppor.dummyCheckbox__c = False;
- }
- else if (Trigger.isUpdate && Trigger.isAfter){
- tp.TotalField(Trigger.new);
- oppor.dummyCheckbox__c = False;
- }
- else if(Trigger.isDelete && Trigger.isAfter){
- tp.TotalField(Trigger.old);
- oppor.dummyCheckbox__c = False;
- }
- }
- }
- if(Trigger.isInsert && Trigger.isAfter){
- //you need to set the checkbox field false here
- //but as this code run in After syntax so first you need to query all Opportunity and then set it to false.
- // and you need to do this in all if conditions.
- tp.TotalField(Trigger.new);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement