Getting Null pointer Exception
Content
Here is the requirement: 1. The Opportunity start date cannot be after the Opportunity End date
2. The Opportunity End date cannot be before the Opportunity Start Date.3. And Opp start date cannot be before the Close DATE
Scripyt:
if(OpportunityStartDate_c!= null && OpportunityEndDate_c!= null && OpportunityEndDate_c.before(OpportunityStartDate_c))
{
throw new oracle.jbo.ValidationException("Opportunity start date cannot be after the Opportunity End date")
}
if (OpportunityStartDate_c.before(EffectiveDate))
{
throw new oracle.jbo.ValidationException("Opportunity start date cannot be before the Close Date")
}
Issue is: If we check the validation Error click on OK the Wrong date is falling in Field. Example: I have given like this Opportunity Start Date: 5/08/2020 and End Date as 3/08.2020 and it throws the error as
Tagged:
1