We'd love to hear from you! Provide  feedback  to earn a badge today. Take our quick survey
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Getting Null pointer Exception

Received Response
19
Views
7
Comments
edited Aug 5, 2020 3:16PM in Sales 7 comments

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:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!