How do I display Opportunities in a Contact page?

  • 1
  • Question
  • Updated 3 years ago
I cannot get any model to display opportunities on my Contact detail page.  I tried using a model for OpportunityContactRoles linked directly by ContactID and nothing comes up.
Photo of Steve Chilcoat

Steve Chilcoat

  • 522 Points 500 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,240 Points 5k badge 2x thumb
Hi Steve~
I want to make sure I understand your question. Is this what you are wanting to show?



If so, this is what your conditions should look like for the contact model and for the OpportunityContactRole model

Here is also the XML for my simple contact detail page: 
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true" tabtooverride="Contact">   <models>
      <model id="contacts" limit="20" query="true" createrowifnonefound="false" adapter="" type="" sobject="Contact">
         <fields>
            <field id="Account.Name"/>
            <field id="Birthdate"/>
            <field id="FirstName"/>
            <field id="LastName"/>
            <field id="Email"/>
            <field id="MobilePhone"/>
            <field id="HomePhone"/>
            <field id="AssistantPhone"/>
            <field id="Phone"/>
            <field id="OtherPhone"/>
         </fields>
         <conditions>
            <condition type="param" value="Id" field="Id" operator="=" novaluebehavior="deactivate" mergefield="Id" enclosevalueinquotes="true"/>
         </conditions>
         <actions/>
      </model>
      <model id="OpptyContactRole" limit="20" query="true" createrowifnonefound="false" adapter="" type="" sobject="OpportunityContactRole">
         <fields>
            <field id="Contact.FirstName"/>
            <field id="Contact.LastName"/>
            <field id="Role"/>
            <field id="OpportunityId"/>
            <field id="Opportunity.Name"/>
            <field id="Opportunity.Amount"/>
            <field id="Opportunity.CloseDate"/>
            <field id="Opportunity.StageName"/>
         </fields>
         <conditions>
            <condition type="param" value="Id" field="Contact.Id" operator="=" enclosevalueinquotes="true" novaluebehavior=""/>
         </conditions>
         <actions/>
      </model>
   </models>
   <components>
      <pagetitle model="contacts" uniqueid="sk-3Fq1lE-245">
         <subtitle>
            <template>{{Model.label}}</template>
         </subtitle>
         <actions>
            <action type="save" label="Save" window="self" icon="sk-icon-save" afterSave="{{Id}}">
               <models>
                  <model>OpptyContactRole</model>
               </models>
            </action>
            <action type="cancel" label="Cancel" window="self">
               <models>
                  <model>OpptyContactRole</model>
               </models>
            </action>
         </actions>
         <maintitle>{{FirstName}} {{LastName}}</maintitle>
      </pagetitle>
      <basicfieldeditor showheader="true" showsavecancel="false" showerrorsinline="true" model="contacts" buttonposition="" uniqueid="sk-3FpbDs-153" mode="edit">
         <columns>
            <column width="50%">
               <sections>
                  <section title="Section A" collapsible="no" showheader="false">
                     <fields>
                        <field id="Account.Name"/>
                        <field id="FirstName"/>
                        <field id="LastName"/>
                        <field id="Email"/>
                        <field id="Birthdate"/>
                     </fields>
                  </section>
               </sections>
            </column>
            <column width="50%">
               <sections>
                  <section title="Section B" collapsible="no" showheader="false">
                     <fields>
                        <field id="Phone" valuehalign="" type=""/>
                        <field id="AssistantPhone" valuehalign="" type=""/>
                        <field id="HomePhone" valuehalign="" type=""/>
                        <field id="MobilePhone" valuehalign="" type=""/>
                        <field id="OtherPhone" valuehalign="" type=""/>
                     </fields>
                  </section>
               </sections>
            </column>
         </columns>
      </basicfieldeditor>
      <pagetitle model="OpptyContactRole" uniqueid="sk-3Fw4xx-210">
         <actions/>
         <maintitle>Opportunities where {{Contact.FirstName}} {{Contact.LastName}} has a contact role</maintitle>
      </pagetitle>
      <skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="OpptyContactRole" buttonposition="" mode="read" uniqueid="sk-3FpcJt-163">
         <fields>
            <field id="Contact.FirstName"/>
            <field id="Contact.LastName"/>
            <field id="Role" valuehalign="" type=""/>
            <field id="OpportunityId" valuehalign="" type="">
               <label>Opportunity</label>
            </field>
            <field id="Opportunity.Amount"/>
            <field id="Opportunity.CloseDate"/>
            <field id="Opportunity.StageName"/>
         </fields>
         <rowactions>
            <action type="edit"/>
            <action type="delete"/>
         </rowactions>
         <massactions usefirstitemasdefault="true">
            <action type="massupdate"/>
            <action type="massdelete"/>
         </massactions>
         <views>
            <view type="standard"/>
         </views>
      </skootable>
   </components>
   <resources>
      <labels/>
      <javascript/>
      <css/>
   </resources>
   <styles>
      <styleitem type="background" bgtype="none"/>
   </styles>
</skuidpage>

Hope this helps!!!
Karen