You need to sign in to do that
Don't have an account?
JKinsey
Date Range Help - Controller Extension
I am attempting to produce a custom VFpage that lists only opportunities within the next year. I'm building an extension to return list views but within my filter criteria.
My issue lies with "And inputdate__c < ??? Today + 365", as seen below from the extension.
I'd rather not create a custom field for Now()+365....
public List<Opportunity> getOpptySum() { return [select name,closedate,account_id__c,inputdate__c,stagename,isclosed from Opportunity WHERE account_id__c = :ApexPages.currentPage().getParameters().get('id') AND isclosed <> true AND inputdate__c < ??? TODAY + 365 Days ORDER BY inputdate__c ASC LIMIT 50 ]; }
Is this not working as below ?
All Answers
Is this not working as below ?
I received
Compile Error: unexpected token: 'onlyDate.addDays'
So I added : before onlydate.addDays
so...
:onlydate.addDays
worked great! Thanks!
Can anybody tell me what the proper terminology for ":" is? Why is it needed and what does it do?
Sorry I missed that ":".
":" is used to specify if we are using a variable in the SOQL .