Wednesday, July 9, 2014

How to query This Fiscal and Last Fiscal Year opportunities?

How to query This Fiscal and Last Fiscal Year opportunities.

You can use THIS FISCAL YEAR and LAST FISCAL YEAR date values to get the opportunities.


list<opportunity> opplist =[SELECT Id,closedate FROM Opportunity WHERE CloseDate = THIS_FISCAL_YEAR limit 10];
system.debug('opplist-->'+opplist);

list<opportunity> opplist2 =[SELECT Id,closedate FROM Opportunity WHERE CloseDate = LAST_FISCAL_YEAR limit 10];
system.debug('opplist2-->'+opplist2); 




0 comments:

Post a Comment

 
| ,