You need to sign in to do that
Don't have an account?
Max_g
Need to get current year records from custom object where year is in a text field.
I need to be able to select current year records from a sales history custom object. The sales year is a text field in the format of CCYY.
How do I code for this in my trigger select statement?
Do you mean you want to look at the current year today and grab those from your query/
If so it would look something like this...
String dateOfToday = String.valueOf(Date.today().year());
Then your SOQL would include this in the where clause...I am assuming the API name of your field
WHERE Sales_Year__c = :dateOfToday
All Answers
Do you mean you want to look at the current year today and grab those from your query/
If so it would look something like this...
String dateOfToday = String.valueOf(Date.today().year());
Then your SOQL would include this in the where clause...I am assuming the API name of your field
WHERE Sales_Year__c = :dateOfToday
Thanks for the quick update. Solved my problem