Monday, June 11, 2012

Salesforce - Custom List buttons for OpportunityLineItem

When trying to create a Visualforce Page to back a Custom List button for Opportunity Product (OpportunityLineItem) I got the following error:

Save error: List controllers are not supported for OpportunityLineItem.

From StandardController recordSetVar OpportunityLineItem issue:

"we restrict list controllers ( standardCOntroller + recordSetVar attribute) to only top-level standard and custom objects so effectively you can not create a list button to a Visualforce page for OpportunityLineItem today" Andrew, Product Manager (11-26-2008)

So that approach is out.

As I wasn't particularly interested in the specific records being selected I was able to make do with a URL content source that redirected to the required Visualforce page and passed the parent Opportunity Id.

As an aside, finding the buttons in the Related List Section required collapsing the Columns and expanding the Buttons area.

See Also: