• stupendous man
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

Receiving error:

Challenge Not yet complete... here's what's wrong: 
Ensure that you modify the COLLABORATION_GROUP query to use the INVENTORY_ANNOUNCEMENTS constant.

static List<CollaborationGroup> COLLABORATION_GROUP = [SELECT Id FROM CollaborationGroup WHERE 
                                                            Name = : Constants.INVENTORY_ANNOUNCEMENTS OR 
                                                            Name = : 'Test'+Constants.INVENTORY_ANNOUNCEMENTS 
                                                            LIMIT 1];

Tried every variation of the query I could think of (database.query, lowercase class reference, only one 'WHERE' clause, no limit, space after 'Test'...all getting same error). Running the above in anonymous apex works fine and returns expected values. Debugged the class and all uses of the Collaboration_Group to verify it's returning the expected values. The rest of the challenge's functionality is as expected: the announcement is made to the group when criteria is met. Nothing appears to be wrong in the logs created when checking the challenge. One of the logs shows the anonymous apex asserting the results of a very similar query. Is there a best practice I'm missing in referencing the constant inside the query?

Receiving error:

Challenge Not yet complete... here's what's wrong: 
Ensure that you modify the COLLABORATION_GROUP query to use the INVENTORY_ANNOUNCEMENTS constant.

static List<CollaborationGroup> COLLABORATION_GROUP = [SELECT Id FROM CollaborationGroup WHERE 
                                                            Name = : Constants.INVENTORY_ANNOUNCEMENTS OR 
                                                            Name = : 'Test'+Constants.INVENTORY_ANNOUNCEMENTS 
                                                            LIMIT 1];

Tried every variation of the query I could think of (database.query, lowercase class reference, only one 'WHERE' clause, no limit, space after 'Test'...all getting same error). Running the above in anonymous apex works fine and returns expected values. Debugged the class and all uses of the Collaboration_Group to verify it's returning the expected values. The rest of the challenge's functionality is as expected: the announcement is made to the group when criteria is met. Nothing appears to be wrong in the logs created when checking the challenge. One of the logs shows the anonymous apex asserting the results of a very similar query. Is there a best practice I'm missing in referencing the constant inside the query?