• Bhavesh Chaudhari 6
  • NEWBIE
  • 5 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
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.
 
/**
     * @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);
    }

 
Hi all,

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.
I implemented the class using the StandardSetController methods but it doesn't work.

Any advice or suggestion?
Thank you.