I have created a new opportunityLineItem:
OpportunityLineItem newOppLineItem = new OpportunityLineItem(OpportunityID=contOpportunity.id, PricebookentryID=contPriceBookEntryID, unitPrice=1, quantity=1);
I use this to populate a grid on a Visualforce page with 1 row. The first column ought to be the name of the product (in the VF page this is referenced as
<apex:inputField value="{!oppLI.Product2.name}" required="false" />
The field is displayed, but is empty; how do I get it to show the product name before the OpportunityLineItem record is saved?
For background the idea is that i display a default product, which the user can change if they desire. Error checking on submit will stop any bad product names from being admitted.
Thanks in advance