+ Start a Discussion
Rogerio Lara 2028Rogerio Lara 2028 

Create a visualforce page that combines 2 custom objects at insert

Hi everyone,

I have 2 custom objects, 1) SCOP and 2)Buying Influence.
The 'SCOP' object is related to 'Opportunities', and the  'Buying Influence' object is related to SCOP.

Opportunity >SCOP > Buying Influence.

I was wondering if it would be possible to create a visualforce page that combines both 'SCOP' and 'Buying Influence' pages into one, so that when I create a new SCOP the Buying Influences are also created at the same time?

Does this make sense?

Thank you,

Rog
Vivek DVivek D
Try creating a Flow page which will help you in achiving this functionality without coding.
Rogerio Lara 2028Rogerio Lara 2028
That is interesting. I will have a go at it. Didn't know that is was possible without coding. ;-)
Thank you,
Rog
Vivek DVivek D
You can even try out similar Trail in Trailhead. You might get some idea.
https://trailhead.salesforce.com/business_process_automation/flow (https://trailhead.salesforce.com/business_process_automation/flow" target="_blank)

Please set best answer if any answer solves your problem
Rogerio Lara 2028Rogerio Lara 2028
I have created a Flow page, but unfortunately it only displays fields in one column. 
I continue to explore ways to have 2 objects visible for editing on the page layout.
Thank you for the suggestion though.
Rog
 
Rogerio Lara 2028Rogerio Lara 2028
These are the 2 visualforce objects I need to display on the same page layout, edit and save.
Any ideas, how I go about merging these into one visualforce page? Any help, more the appreciated! ;-)

<apex:page standardcontroller="Opportunity_Positioning__c">
<apex:messages />
    <apex:sectionheader title="{!$ObjectType.Opportunity_Positioning__c.label} Edit" subtitle="{!IF(ISNULL(Opportunity_Positioning__c.Name), 'New Strategic Client Opportunity Plan',Opportunity_Positioning__c.Name)}"/>
    <apex:form >
        <apex:pageblock mode="edit" title="{!$ObjectType.Opportunity_Positioning__c.label} Edit">
            <apex:pageblockbuttons >
                <apex:commandbutton value="Save" action="{!Save}"/>
                <apex:commandbutton value="Cancel" action="{!Cancel}"/>
            </apex:pageblockbuttons>

            <!-- **********   [Record Type : Master ]   **********  -->
            <apex:outputpanel >
                <apex:pageblocksection title="Information" showheader="true" columns="2">
                    <apex:inputfield value="{!Opportunity_Positioning__c.Name}" required="true"/>
                    <apex:pageblocksectionitem />
                    <apex:inputfield value="{!Opportunity_Positioning__c.Opportunity__c}" required="true"/>
                    <apex:pageblocksectionitem />
                </apex:pageblocksection>
                <apex:pageblocksection title="Summary of my position today" showheader="true" columns="2">
                    <apex:inputfield value="{!Opportunity_Positioning__c.Current_Status__c}" required="false"/>
                    <apex:inputfield value="{!Opportunity_Positioning__c.Key_Actions_Required__c}" required="false"/>
                    <apex:inputfield value="{!Opportunity_Positioning__c.Strengths__c}" required="false"/>
                    <apex:inputfield value="{!Opportunity_Positioning__c.Red_Flags__c}" required="false"/>
                    <apex:pageblocksectionitem />
                    <apex:inputfield value="{!Opportunity_Positioning__c.Adequacy_of_Current_Position__c}" required="false"/>
                </apex:pageblocksection>
                <apex:pageblocksection title="Competitive Positioning" showheader="true" columns="2">
                    <apex:inputfield value="{!Opportunity_Positioning__c.Position_vs_c__c}" required="false"/>
                    <apex:inputfield value="{!Opportunity_Positioning__c.Primary_Competitor__c}" required="false"/>
                </apex:pageblocksection>
            </apex:outputpanel>
        </apex:pageblock>
    </apex:form>
    <center><br/>
        <i style="font-size:10px;color:#aaa;">Generated By LAYOUT PAGE <a href="http://www.clerisoft.com" target="_blank">[http://www.clerisoft.com]</a> (2008-2014) : Mon Oct 10 2016 15:47:12 GMT+0100 (GMT Daylight Time)</i>
    </center><br/>
</apex:page>

and

apex:page standardcontroller="Buying_Influence__c">
<apex:messages />
    <apex:sectionheader title="{!$ObjectType.Buying_Influence__c.label} Edit" subtitle="{!IF(ISNULL(Buying_Influence__c.Name), 'New Buying Influence',Buying_Influence__c.Name)}"/>
    <apex:form >
        <apex:pageblock mode="edit" title="{!$ObjectType.Buying_Influence__c.label} Edit">
            <apex:pageblockbuttons >
                <apex:commandbutton value="Save" action="{!Save}"/>
                <apex:commandbutton value="Cancel" action="{!Cancel}"/>
            </apex:pageblockbuttons>

            <!-- **********   [Record Type : Master ]   **********  -->
            <apex:outputpanel >
                <apex:pageblocksection title="Information" showheader="true" columns="2">
                    <apex:inputfield value="{!Buying_Influence__c.Name}" required="true"/>
                    <apex:inputfield value="{!Buying_Influence__c.SCOP__c}" required="true"/>
                    <apex:inputfield value="{!Buying_Influence__c.Name__c}" required="false"/>
                    <apex:pageblocksectionitem />
                    <apex:inputfield value="{!Buying_Influence__c.Buying_influence_role__c}" required="false"/>
                    <apex:pageblocksectionitem />
                    <apex:inputfield value="{!Buying_Influence__c.Degree_of_Influence__c}" required="true"/>
                    <apex:pageblocksectionitem />
                    <apex:inputfield value="{!Buying_Influence__c.Mode__c}" required="true"/>
                    <apex:pageblocksectionitem />
                </apex:pageblocksection>
                <apex:pageblocksection title="How well is based covered for this contact" showheader="true" columns="1">
                    <apex:inputfield value="{!Buying_Influence__c.Rating_for_base_covered__c}" required="true"/>
                    <apex:inputfield value="{!Buying_Influence__c.Evidence_to_support_your_rating__c}" required="false"/>
                </apex:pageblocksection>
            </apex:outputpanel>
        </apex:pageblock>
    </apex:form>
    <center><br/>
        <i style="font-size:10px;color:#aaa;">Generated By LAYOUT PAGE <a href="http://www.clerisoft.com" target="_blank">[http://www.clerisoft.com]</a> (2008-2014) : Mon Oct 10 2016 15:42:28 GMT+0100 (GMT Daylight Time)</i>
    </center><br/>
</apex:page>