You need to sign in to do that
Don't have an account?
Rory Figgins 18
Advanced Apex Superbadge Step 7
Sorry for the hijack, I can't create my own post.
Error:
Ensure that you implement all the pagination methods using the corresponding StandardSetController methods.
I am having an issue with validating the ext.getTotalPages method.
Here is my method toSetStandardSetController
Error:
Ensure that you implement all the pagination methods using the corresponding StandardSetController methods.
I am having an issue with validating the ext.getTotalPages method.
/** * @name GetTotalPages * @description **/ public Integer getTotalPages(){ return ((Decimal)this.standardSetController.getResultSize() / (Decimal)Constants.DEFAULT_ROWS).round(System.RoundingMode.CEILING).intValue(); }
Here is my method toSetStandardSetController
private void setStandardSetController() { if (this.selectedFamily != Constants.SELECT_ONE && this.selectedFamily != null) { this.standardSetController = new ApexPages.StandardSetController(Database.getQueryLocator([ SELECT Id, Product2.Name, Product2.Family, Product2Id, UnitPrice, Product2.Quantity_Remaining__c FROM PricebookEntry WHERE Product2.IsActive = true AND Product2.Family =: this.selectedFamily ])); } else { this.standardSetController = new ApexPages.StandardSetController(Database.getQueryLocator([ SELECT Id, Product2.Name, Product2.Family, Product2Id, UnitPrice, Product2.Quantity_Remaining__c FROM PricebookEntry WHERE Product2.IsActive = true ])); } this.standardSetController.setPageSize(Constants.DEFAULT_ROWS); }
All Answers
This method is referenced directly inside of the visualforce page, no referencing is required in the controller.
When Salesforce validates the Superbadge Challenge they run Apex assertions, calling the method directly. I am failing the challenge on the assetion of the getTotalPages() method. After spending an hour or so reviewing the code and fundamental functionality I can't see anything particularly wrong.
From the developer console:
13:04:31:053 EXCEPTION_THROWN [4]|System.AssertException: Assertion Failed: ext.getTotalPages() did not return the expected result.
and on Trailhead I'm getting:
Challenge Not yet complete... here's what's wrong:
Ensure that you implement all the pagination methods using the corresponding StandardSetController methods.
Cloud you please sharing the code for me
I do not know why it can been fix
please give me some advice
Got it fixed with
In OrderExtension constructor
Thanks @rocco. I have fixed it by having only 15 pricebookentires (remaining deleted).
Thanks,
Praveen Murugesan,