Skip to Content

TheBlogReaders.com

Salesforce.com, PHP, MySQL, Javascript, Ajax, Htacces

How to get the current year records from custom object where year is in a text field

Be First!
by December 28, 2012 APEX, SALESFORCE, SOQL

How to get the current year records from custom object where year is in a text field?

String dateOfToday = String.valueOf(Date.today().year());

Then your SOQL would include this in the where clause.

Note: Use the API name of your field

WHERE Sales_Year__c = :dateOfToday

(705)

Previous
Next

Leave a Reply