function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MattiasNordin.ax607MattiasNordin.ax607 

How to join in another object on a visual force page

Im trying to learn visual force pages and want to add information from the campaign object on a contact visual force page. How can that be done?`

I guess the URL need to contain input for both objects. How does that work?

 

https://flir.secure.force.com/offer?id=0032000000PTk9aAAD&rCC=1234

 

id=0032000000PTk9aAAD is somehow inputted to the contact controller. How do i send input to the custom class that fetches info from the campaign object.

 

(im new to java. have only scripting experience. trying to learn)

_Prasu__Prasu_

Checkout the following post.

http://salesforcesource.blogspot.com/2008/10/how-to-create-custom-related-list-on.html

 

I hope this will help.

 

Else you can check the integration logic of the Standard controller and extension class in the same code.

Pradeep_NavatarPradeep_Navatar

Basically you can send some input from visual force page for a compaign object through <apex:param> component. go throught the sample code given below :

 

            <apex:page standardController="Contact">

            <apex:pageBlock title="Hello {!$User.FirstName}!">

            You are displaying contacts from the {!contact.name} .

            Click a contact's name to view his or her details.

            </apex:pageBlock>

            <apex:pageBlock >

            <apex:form >

                <apex:dataTable value="{!contact.CampaignMembers}" var="compaignmember" cellPadding="4" border="1">

                    <apex:column >

                                <apex:facet>Name</apex:facet>

                                    <apex:commandLink >

                                    {!compaignmember.Campaign.Name}

                                   <apex:param name="cid" value="{!compaignmember.CampaignId}"/>

                                    </apex:commandLink>

                   </apex:column>

                </apex:dataTable>

            </apex:form>

            </apex:pageBlock>

            <apex:detail subject="{!$CurrentPage.parameters.cid}" relatedList="false" title="false"/>

 

Hope this helps.