You need to sign in to do that
Don't have an account?
Rocco Sorrentino
Advanced Apex Superbadge (PDII) Step 7
Hi all,
I'm getting an error while verifying step 7:
Any advice or suggestion?
Thank you.
I'm getting an error while verifying step 7:
- Challenge Not yet complete... here's what's wrong: Ensure that you implement all the pagination methods using the corresponding StandardSetController methods.
Any advice or suggestion?
Thank you.
I would guess perhaps you have a small typo or wrong method in one of them. Here is a sample of my methods that got passed that error:
It sounds like you are doing the exact same as it sounds from your post, maybe just double check for a typo/wrong method.
All Answers
I would guess perhaps you have a small typo or wrong method in one of them. Here is a sample of my methods that got passed that error:
It sounds like you are doing the exact same as it sounds from your post, maybe just double check for a typo/wrong method.
yes it works.
I changed the variable from stanCon to standardSetController.
Thank you.
Could you share your order extension class, my pagination is not working fine, also in case of edit, do we need show existing product only?
I am getting below Error
Challenge Not yet complete... here's what's wrong:
Ensure that you implement all the pagination methods using the corresponding StandardSetController methods.
Below is the class that I am using
Yes, Please make sure you do not have more than 15 Products in the Org where you are testing the same
Thanks Amit.
I solved it by adding LIMIT 14 in the query that I pass in to
Now there are only three pages, to :|
standardSetController = null;
1. I was able to complete the challenge with 8 active price book entries. [ I had initially not set price-book record isActive status to active/inactive while writing the save method for Product2Extension.apxc. I changed that to new PricebookEntry(UnitPrice=ppr.getPriceBookRecord().UnitPrice,PriceBook2Id=Constants.STANDARD_PRICEBOOK_ID,isActive=ppr.getProductRecord().IsActive)
2. Once you get the above working chances are that the pagination error goes away. (If it doesn't, add plenty of debug in the GetTotalPages method to understand what is happening.
public Integer GetTotalPages(){
System.debug('standardSetController.getResultSize()'+standardSetController.getResultSize());
System.debug('(Decimal)Constants.DEFAULT_ROWS'+(Decimal)Constants.DEFAULT_ROWS);
Integer totalPages = (Integer)Math.ceil(standardSetController.getResultSize() / (Decimal)Constants.DEFAULT_ROWS);
System.debug('############ totalPages: ' + totalPages);
return totalPages;
}
3. You might be facing some "Assertion Failed" errors after this. It has to do with your org data (I have set quantity and unit price as '1' for the second page which was precisely what I shouldn't have set to pass the test :P ). I suggest opening the raw log, copy-pasting the apex in an anonymous window and executing it. It would help you locate the exact assert where its failing.
I hope the above helps!
Ensure that values are preserved during pagination
.
someone please help me regar this thanks in advance.
@Bhavesh Chaudhari 6
Can u suggest how can we avoid this error "Ensure that values are preserved during pagination."?