+ Start a Discussion

opportunity amount in column header total value

Hi all .
I have opportunity object which has lookup to same opportunity (simply one one opportunity has 4 opportunities) how to display the opportunity amount in column header total value?
Gaurav Jain 103Gaurav Jain 103

Please read the below article :

How to Create an Opportunity Hierarchy, Parent Opportunity or Opportunity Bundles
 does not have standard functionality that simulates an Opportunity Hierarchy. However, depending on your business needs, you may be able to simulate an Opportunity hierarchy by creating a custom object (Parent Opportunity or Opportunity Bundle) to associate other opportunities with via a Lookup Relationship.

The following scenario uses a custom object called "Parent Opportunity" and a Lookup Relationship field on the standard Opportunities object to associate standard Opportunity records with the custom Parent Opportunity record. This is a One to
Many relationship between a Parent Opportunity and  Opportunities. The Parent Opportunity is simply used to group the Opportunities and reporting is facilitated using the Report object to create a custom report to fit your business needs.

This method of creating an Opportunity Hierarchy is not very flexible however using a Summary Report, the report is able to sum the Opportunity Amount values and average the Probability values and show the sum and average on the same line as the Parent Opportunity Name, thus rolling up the values from all Opportunity records and associating them with the proper Parent Opportunity line on the report. This is only useful for a visual representation of data, if the Parent Opportunity records require that values from the Opportunity records roll up for display on the Parent Opportunity record, this is not possible without additional APEX or S-control coding. Please closely evaluate your business needs before you commit to using this method to create your Opportunity Hierarchy.

Follow the instructions below to replicate this behavior.

STEP 1: Create a new custom object named "Parent Opportunity". SETUP | App Setup | Create |Objects | Click the "New Custom Object" button.
  • If you plan to name each Parent Opportunity record, choose Data Type "Text" when creating the new custom object.
  • Make sure the object is reportable by checking the Allow Reports or Enable Reports check-box.
  • Decide if this object should have its own Notes and Attachments related list and make the appropriate selection in the check-box titled "Add Notes and Attachments related list to default page layout".
  • Decide if this object should have its own tab. If it should have its own tab, make a selection in the check-box titled "Launch New Custom Tab Wizard after saving this custom object".

STEP 2: Create a new custom Lookup Relationship field on the Opportunities object. SETUP | App Setup | Customize | Opportunities | Fields | Click the "New" button in the section titled "Opportunity Custom Fields & Relationships".
  • The lookup relationship field should be Related to The custom object you created in Step 1 (Parent Opportunities).
  • Add the lookup relationship field to the Opportunities Page Layout.

STEP 3: Create a new Custom Report by going to the Reports tab and clicking the "Create New Custom Report Button".
Given that in Step 1 you enabled reporting for the new custom object, and you created a lookup relationship field on the Opportunities object, you should have a new report type available to you in the Report Wizard.
  • Report Wizard Step 1: Select Opportunities as the data type you wish to report on.
    Look for Opportunities and Parent Opportunity (or name of custom object created in Step 1) as an option in the report type list.
    Select Summary Report for the report format.
  • Report Wizard Step 2: Check the Sum check-box for the Amount column and the Average check-box for the Probability check-box. This will associate the total Amount value and the average probability value of all Opportunities with the related Parent Opportunity.
  • Report Wizard Step 3: Summarize the information by Parent Opportunity Name.
  • Report Wizard Step 4: Select the data fields that you wish to display for your report. Typical fields you might want to check to display are:
Opportunity Information - Opportunity Owner, Opportunity Name, Close Date, Stage, Amount, and Probability (%).  
Account: General - Account Name
Parent Opportunity - General: Parent Opportunity: Name
  • Report Wizard Step 5: Order the Selected Columns as desired.
  • Report Wizard Step 6: Enter any additional criteria. If you wish the report to display only the Parent Opportunity data you can check the Hide Report Details check-box and the individual opportunity report results will be hidden but the Parent Opportunity summary report lines will display the Average Probability and Total Amount of all opportunities associated with the Parent Opportunity.
  • Save the report with the name "Opportunity Hierarchy Report". Save the report to a folder where you can easily find it so that it can be accessed and run later.
STEP 4: Create a Parent Opportunity record and save it. Create several Opportunities and select the name of the proper Parent Opportunity record on the Parent Opportunity lookup field. Run the report that you saved in the previous step to test it out.

FINAL STEP: Add additional customization such as APEX code and Workflow triggers to meet additional business needs. Some things you may want to consider for further customization:

-Create validations for the Parent Opportunity object so that its record cannot be closed until all the Opportunities related via lookup have also been closed won/lost.

-Adding your Opportunity Hierarchy report to dashboards.

-Using Apex Triggers to update Parent Opportunity Objects with totalized Amounts from related Opportunities.


Please mark this as  best answer if your query is resolved, so it will help others in future.

Gaurav Jain