• Hieu V. Truong
  • NEWBIE
  • 10 Points
  • Member since 2015
  • Network System Administrator
  • ECi Software Solutions

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
Is it possible to query the year of a Holiday Record?

I created an Easter 2019 Holiday with the date of 4-21-2019

I tried the following:
Integer thisYear = date.today().year();
List<Holiday>Easter = [Select Id, ActivityDate,Name from Holiday where Name like '%Easter%' and Calendar_YEAR(ActivityDate) =:thisYear];


Received this error message: 
like '%Easter%' and Calendar_YEAR(ActivityDate) =:thisYear
                                  ^
ERROR at Row:1:Column:88
field ActivityDate does not support date function CALENDAR_YEAR


Any ideas anyone?
Hello,

I'm trying to filter NewValue and OldValue on OpportunityFieldHistory and am getting an error on the Query Editor.

Here's my statement: Select Id, CreatedById, CreatedDate, Field, NewValue, OldValue from OpportunityFieldHistory Where Field = 'StageName' AND CreatedDate = Last_Month AND OldValue !='Owned Lead' AND NewValue='Owned Lead'

Error Message: [object Object]: AND CreatedDate = Last_Month AND OldValue !='Owned Lead' AND NewValue='Owned ^ ERROR at Row:1:Column:152 field 'OldValue' can not be filtered in a query call

Any ideas anyone?

Thanks,
Hieu