I am doing some work for a client and they have asked if I could make a "child/parent" relationship between OpportunityLineItem (OLI) records.
I have been told by someone they have seen it done before and it has been done by adding a lookup to the Product2 to another Product2 record.
The client then wants the OLI parents to be displayed on a page (I will be using apex:repeat for this due to the table style), they they want a nested table within this table where they display the child OLI's. I have been able to work the VF side so far and it all looks good.
However I have been racking your brains trying to work out how to do this... but I just can not get it to work D: does anyone have any ideas or pointers?
I just need the most basic set of fields from the OLI's to display, it's literally just the Name, Quantity, Discount, ListPrice, UnitPrice and TotalPrice from both the parent and child.
****UPDATE**** I am displaying the Opp at the top of a VF page, then under that I need to display a table of all of the Parent/"Master" OLI's and in each OLD row, I need to display the Child/"Extra" OLI's so it will be kind of like this:
-------- Opp Info --------
| Name Stage |
--------------------------
| OLI 1 Master Details |
| |
| --------------------- |
| |OLI 1 Child Details| |
| --------------------- |
--------------------------
| OLI 2 Master Details |
| |
| --------------------- |
| |OLI 2 Child Details| |
| --------------------- |
--------------------------