You need to sign in to do that
Don't have an account?
enossir
So when the opp stagename is closed won then the close date is switched to today, no i didnt use a workflow because theres too much business logic on other handlers that work off the opportunity install and close dates.
but the problem is, is when the install date > close date before this class updates. Ie
install date = 1/13/2019
close date = 1/4/2019 apex class field update ---> 1/2/2019
but what fires off is this
Because it's reading the previous value of the closedate, now these are on old opps obviously....but a lot of them are like this. I'd really hate to have to hard code another validation rule into my class handler.
Apex class field update clashing with a validation rule.
// before update, process only trigger.new opps and trigger.old maps public static void befUpdate(List<Opportunity> newOpps, Map<Id,Opportunity> oldMapOpps){ oppFldUpdates(newOpps,oldMapOpps); OppFiscalQuarterDates(newOpps); validateOppUpdate(newIGTOpps,oldMapOpps); for (Opportunity opp : newOpps){ if(opp.Signature_Received__c == true) opp.StageName = 'Closed Won'; if(opp.StageName == 'Closed Won')opp.CloseDate = date.today(); } }
So when the opp stagename is closed won then the close date is switched to today, no i didnt use a workflow because theres too much business logic on other handlers that work off the opportunity install and close dates.
but the problem is, is when the install date > close date before this class updates. Ie
install date = 1/13/2019
close date = 1/4/2019 apex class field update ---> 1/2/2019
but what fires off is this
AND(Install_Date__c <= CloseDate, ISPICKVAL( Term_Conversion__c ,"") )
Because it's reading the previous value of the closedate, now these are on old opps obviously....but a lot of them are like this. I'd really hate to have to hard code another validation rule into my class handler.