
17 respostas

Hi Zachery,
I changed the reference of StandardListController to PriceBookeEntry but now showing the error to: Challenge Not yet complete... here's what's wrong: Ensure that you implement all the pagination methods using the corresponding StandardSetController methods.
In the OrderQueryRecord method: I added a condition to fetch all active pricebookentries for the order item:
public static Order QueryOrderRecord(Id orderId){ SELECT Id, AccountId, EffectiveDate, Name, Status, Pricebook2Id, ( SELECT Id, OrderId, Quantity, UnitPrice, PricebookEntryId, Product2Id, Product2.Name, Product2.Family, Product2.Quantity_Remaining__c FROM OrderItems where PricebookEntry.isActive = true ) FROM Order WHERE Id = :orderIdBelow I assigned StandardController to PriceBookeEntryConstructor: public OrderExtension(ApexPages.StandardController standardController){ orderRecord = (Order)standardController.getRecord(); orderItemMap = new Map<id,OrderItem>(); if ( orderRecord.Id != null ){ orderRecord = queryOrderRecord(orderRecord.Id); } orderItemList = new List<OrderItem>(); OrderItemList.addAll(orderRecord.OrderItems); set<Id> p2ids = new set<Id>(); for(OrderItem oitem : OrderItemList){ p2ids.add(oitem.PriceBookEntryId); } List<PriceBookEntry> p2List = new List<PriceBookEntry>(); if(p2Ids.size()>0){ p2List = [select id from PriceBookEntry where id IN: p2Ids]; } standardSetController = new ApexPages.StandardSetController(p2List); standardSetController.setPageSize(Constants.DEFAULT_ROWS); }Still not able to fix this issue.