function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NishaCNishaC 

Error Message: Service is not active

i have a problem of getting error message at the wrong time

 

Date From: 01/06/2011 - Date To: 12/09/2012 - show me data
we would say 'sorry, your services were not active 01/06/2011'
 becasue service start date  is 01/01/2012


for this i have applied this error message

if(dateFrom < sr.Service_Start_Date__c){
      ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error,'Service is Not Active'));
      return null;
}

 

But i have more than 1 service start date

8/1/2011

16/9/2010

1/8/2011

4/5/2010

11/1/2012

1/12/2011

15/11/2010

25/7/2011

27/10/2010

 

so when i entered DateFrom = 1/1/2012

it is showing me the error message 

any help

kamlesh_chauhankamlesh_chauhan

Nisha,

 

If you could give few more examples with sample data that would be great.

 

I need to understand when it should display the error message and when it should display the data.

 

Regards,

Kamlesh

NishaCNishaC

see i have a visualforce page with DateFrom and DateTo fields

DateFrom that user selected and service start date is field from list where all services are active

so Service_Start_date__c  data is coming from list 

 

Service Start Date                                 DateFrom

8/1/2011                                                  1/1/2012

16/9/2010                                                1/1/2012

1/8/2011                                                   1/1/2012

4/5/2010                                                   1/1/2012

11/1/2012                                                 1/1/2012

1/12/2011                                                 1/1/2012

15/11/2010                                               1/1/2012

25/7/2011                                                 1/1/2012

27/10/2010                                               1/1/2012

 

if i am using this error message

if(dateFrom < sr.Service_Start_Date__c){
       ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error,'Service is Not Active'));
       return null;
}

 

there is no data for 2009,2008 and previous year

so when i select DateFrom 1/1/2008 it should give me error message

 

if u have any question then plz ask

 

then it is valid for some data that i am using here 

 

Nazeer AhamedNazeer Ahamed

Are you connecting Salesforce.com web services?

NishaCNishaC

no.....

Anil MeghnathiAnil Meghnathi

Nisha

 

You have list of Service start Date,but for how much period this service will be available.means for specific numbers of days,or Service Stop Date?Do you have any one of this???

 

Thanks

Anil