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
BoSoxFanBoSoxFan 

Visual Force controller for OpportunityLineItem?

Is there a standard controller for OpportunityLineItems? I'm able to set it in the page header howerver I get an "Unable to access page" when trying to access this page with a valid OpportunityLineItem Id.

<apex: page standardController="OpportunityLineItem">
<apex: pageBlock title="Hello {!$User.FirstName}!">
</apex: pageBlock>
<apex: detail/>
</apex: page>

Ron HessRon Hess
Can you use the opportunity custom object, then access the list of line items using the related list of the opportunity ?
it's as good as having a standard controller on that object.
mtbclimbermtbclimber
You should be able to access the data from the opportunitylineitem from the standard controller. It appears, however, that apex:detail is not supporting opportunitylineitem.  We'll check into whether that is something we can fix shortly.

Regards,
BoSoxFanBoSoxFan
Thanks Andrew for the quick response. I'll build out the using the controls until that is fixed.
dchasmandchasman
FYI I have the fix for this queued up for release in the first Summer '08 patch
DS777DS777
How about Products?Even for products it is the same problem PricebookEntry does not work with related list
mtbclimbermtbclimber
Not sure I understand this question. 

What I can say about PricebookEntry is that there is no related list that uses that entity directly and nor is it layoutable which is the requirement for use with apex:detail.

PricebookEntry is a very limited, specific standard object. It is important to understand it's place with OpportunityLineItem. I recommend checking out one of the schema browsing tools like eclipse or soqlxplorer to understand the data model here. There is also an ERD in the api documentation if memory serves.