You need to sign in to do that
Don't have an account?
Eric Schrager
Advanced Apex Superbadge (PDII) Step 6
I'm at Challenge 6 and I'm stuck. I've tested that my code produces the Chatter post to the group, and my AnnouncementQueueable class implements Queuable. I've implemented the excecute() method. But still I get this error:
"Challenge Not yet complete... here's what's wrong:
Ensure that you implement the Queueable interface in the announcementsQueueable class."
Anyone have an answer? I'd love to complete my PDII before end of year. This feels like a testing defect.
"Challenge Not yet complete... here's what's wrong:
Ensure that you implement the Queueable interface in the announcementsQueueable class."
Anyone have an answer? I'd love to complete my PDII before end of year. This feels like a testing defect.
All Answers
public static List<Product2> ConstructProducts(Integer cnt){
Originally, I had done Product2[], which is the same thing but it isn't what the evaluator wanted to see. I had to change it to the above to pass.
"Ensure constructOrders returns a list of size cnt of Order records related to the provided Accounts with all of the required fields populated."
My construct order method is below :
public static List<Order> ConstructOrders(Integer cnt, List<Account> accts){
//ToDo: Ensure this method returns a list of size cnt of uniquely named Order records
// related to the provided Accounts
// with all of the required fields populated.
List<Order> ordList = new List<Order>();
for(Account acc : accts){
for(Integer i = 0; i<cnt ; i++){
Order con =new Order(AccountId = acc.Id,EffectiveDate=system.today(),Status='Draft',PriceBook2Id=Constants.STANDARD_PRICEBOOK_ID,Name='Test'+i);
ordList.add(con);
break;
}
}
return ordList;
}
1. Don't loop through the accounts. Just do the Integer loop. Assign each order to accts[i].
2. Make sure you use your Constants class for the value to assign the Status field.
Can you share your code of TestDataFactory class. I can cross check to see what exactly is preventing from failing my challenge.
public static List<Order> ConstructOrders(Integer cnt, List<Account> accts){
List<Order> orderList = new List<Order>();
for (Integer i=0; i < cnt; i++) {
orderList.add(new Order (Name = 'test' + i, AccountId = accts[i].id, Status = Constants.DRAFT_ORDER_STATUS, EffectiveDate = System.Today()));
}
return orderList;
//ToDo: Ensure this method returns a list of size cnt of uniquely named Order records
// related to the provided Accounts
// with all of the required fields populated.
}
Ensure that you implement the Queueable interface in the announcementsQueueable class." i am getting this error like you and your link is not working anymore how did you solve your problem ?