Skip to main content Stream TDX Bengaluru on Salesforce+. Start learning the critical skills you need to build and deploy trusted autonomous agents with Agentforce. Register for free.
Hi all,

I have completed Step 6 of this super badge and I've confirmed that the functionality works just fine, but I'm getting the following error

Ensure that you modify the COLLABORATION_GROUP query to use the INVENTORY_ANNOUNCEMENTS constant.

In my code, I'm already using this constant to query the chatter group id when building the announcement, in Product2Helper

 

List<CollaborationGroup> chatterGroups = [SELECT Id FROM CollaborationGroup WHERE Name = :Constants.INVENTORY_ANNOUNCEMENTS LIMIT 1];

announcement.parentId = chatterGroups[0].Id;

I've also tried

 

announcement.parentId = [SELECT Id FROM CollaborationGroup WHERE Name = :constants.INVENTORY_ANNOUNCEMENTS][0].Id;

Has anyone faced this error? How did you build the query? 

 
2 个回答
  1. 2017年12月20日 10:58
    I figured this out....I hadn't realised that the query was prebuilt as a static list at the beginning of the class. THAT is the query that needs to use the constant. I was building my own query. I've passed the challenge

     

    static List<CollaborationGroup> COLLABORATION_GROUP = [

    SELECT Id

    FROM CollaborationGroup

    WHERE Name = :Constants.INVENTORY_ANNOUNCEMENTS

    OR Name = :('TEST'+Constants.INVENTORY_ANNOUNCEMENTS)

    LIMIT 1

    ];

     
正在加载
0/9000