function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ANKUR KUMAR 58ANKUR KUMAR 58 

Superbadge Advanced Apex Specialist step 8 issue

Hi 
I am doing Superbadge Advanced Apex Specialist. I have completed 7 steps successfully. I am doing development in developer console. 
When I am clicking on check challenge on step 8 I am getting below error
User-added image

As all other chalenges are already completed how can i fix the issue because i am unable to retake those steps again (I am not getting any option to check chalange for completed chalenges). I am also not having previous code as I am doing development in developer console.

I am ready to retake all changes again but how can I do it without creating other trailhead account.
SandhyaSandhya (Salesforce Developers) 
Hi,

Did you refer below link for similar discussion.

https://developer.salesforce.com/forums/?id=9060G0000005OX0QAM
 
https://developer.salesforce.com/forums/ForumsMain?id=9060G0000005QQaQAM
 
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
 
Best Regards
Sandhya
 
ANKUR KUMAR 58ANKUR KUMAR 58
Hi Sandhya,
Thanks a lot for your reply. I checked theese links and these links says that product count should be 12. in my developer console logs. Count query is returning 12 but still Assert Exception is showing in logs. here is the screen shot.User-added image
Manohar kumarManohar kumar

Hi Ankur,

can you pls paste you class and test class. you can also try creating a new playground run your classes there, hope this will help.  
Thanks,
Manohar

Tripti Nirmal GuptaTripti Nirmal Gupta
 System.QueryException: List has no rows for assignment to SObject error when running test classes.
Can someone help with how this issue is fixed
sfadmin 182sfadmin 182
Hi, this may be a bit too late given the post is over 1 year old already, but i was having hte same issue and solved it by editing the ProductWrapper constructor. The debugs were showing initially that the superbarge challenge assertion was failing due to tyhe product missing required field Name. After adding name and isActive to true the checks passed.
 
public ProductWrapper() {
            productRecord = new Product2(Initial_Inventory__c =0, Name='Test Product', isActive=true);
            pricebookEntryRecord = new PricebookEntry(Unitprice=0.0);
            
        }

Hope this helps you or anyone else running into this issue.
Kent Heberling 24Kent Heberling 24

sfadmin 182's response solved this for me! The error message provided wasn't helpful enough to figure out what was going, on and previous tests and functionality were still working! I even tracked my work in a local git project and verified I had not made any changes since first coding this for step #3.

There were other posts that mentioned needing to update the number of products in the system, removing validation from Product2Extension.Save(), but those suggestions did not work. 

Spoorthi MSpoorthi M
@sfadmin 182, Thank you so much!
Saran SSaran S
@sfadmin 182, Thank you so much!
Tomás Ramírez GarcíaTomás Ramírez García
Thanks a lot!

All code coverage and tests fine and me going mad in the afternoon!

How imagine that the constructor expected was
 
public ProductWrapper() {
             productRecord = new Product2(Initial_Inventory__c =0, Name='Test Product', isActive=true);
             pricebookEntryRecord = new PricebookEntry(Unitprice=0.0);
}


  And not...
 
public ProductWrapper() {
             productRecord = new Product2();
             pricebookEntryRecord = new PriceBookEntry();         
}



Which was working for previous challenge.

Hard journey in fixing weird errors with this superbadge and Aura Component Specialist in PDII trailmix!