• Alice Ju
  • NEWBIE
  • 10 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
Hi there,
I'm trying to add Test.StartTest() in my test class, but I kept getting this error message.

"Error: Compile Error: Variable test is used before it is declared. at line 4 column 46"

I then go back and check if I have any class called "test" that override the test method, but I can't find any. Do you guys happen to know where the error comes from? If you can kindly give me some advice I'll very much apprecaite. Thank you!

User-added image

Hi there,

 

I have a querry in my apex trigger that looks like this:

 

      List<DatedConversionRate> ExchRateCache = [SELECT ISOCode, ConversionRate,  StartDate, NextStartDate FROM DatedConversionRate where ISOCode in :CurrCodes ];

 

This works fine, but it pulls the currency exchange rate of all time, and I only want the exchange rate on the 1st day of the month. I then changed it as below.

 

      List<DatedConversionRate> ExchRateCache = [SELECT ISOCode, ConversionRate,  StartDate, NextStartDate FROM DatedConversionRate where ISOCode in :CurrCodes AND ExchRateCache.StartDate.Day()='1'];

 

But I got an error saying "unexpected token: ')' at line 70 column 192"

 

Can some one be so kind and give me some instruction? Very much appreciate!

Alice