You need to sign in to do that
Don't have an account?
Want to display records with EndDate equals to null as well as greater than today in salesforce
The apex controller which iam using is extending DynamicListController. In the constructor i have the code
public Level2Controller(){
super('select Id,Name,Approved_By__c,Approval_Date__c,Level2_Active_Status__c,Level2_End_Date__c from Level2__c');
}
and in the below method i have the code
public override String getWhereClause() {
-
-
-
return 'where Level1__c= \''+useractivelevel[0].Level1__c+'\' and Level2_Active_Status__c=True and (Level2_End_Date__c >='+myDate+' or Level2_End_Date__c=\''+null+'\')';
}
but Iam getting following error
Attempt to de-reference a null object
An unexpected error has occurred. Your development organization has been notified.
If at all I query with >=mydate but not with =null , then the query is working fine. Also same conditions working in filter criterias, formula fields and SOQL .
Please any body look into this and suggest me.
Thanks,
Haripriya
You don't need to put the null outside the string, as its a literal as far as the query parser is concerned.
I think the following should work:
All Answers
You don't need to put the null outside the string, as its a literal as far as the query parser is concerned.
I think the following should work:
Thanks for your quick reply
Even I tried with the same query but I got same error as above I said.
Hi bob,
Its working. previously I made a typo in the query.
Thank you .