+ Start a Discussion
varivari 

new window from apex

Iam displaying a campaigns on opportunity detail page using a visual force page and when the campaign is clicked which is displauyed on opportunity campign detail is opening in that visual force page (block in opportunity page). when the campaign is clicked it should open  in a new window 

 

can anyone help me doing that 

Best Answer chosen by Admin (Salesforce Developers) 
Devendra@SFDCDevendra@SFDC

Hi,

 

Try to add Campaign.Name field inside a query for CampaignMembers.

 

<apex:pageBlockTable value="{!lstCampaignMember}" var="campaignMember" cellPadding="4" border="1">
	<apex:column> 
		<apex:outputLink value="/{!campaignMember.campaignId}" targer="_blank">
			{!campaignMember.Campaign.Name}
		 </apex:outputLink>
	</apex:column>
	<!-- Rest of the columns follows -->
</apex:pageBlockTable>

 

Thanks,

Devendra

 

 

All Answers

Devendra@SFDCDevendra@SFDC
Hi,

You might be using a link to open that page.

You need to add one more attribute there.
i.e. target = "_blank"

Thanks,
Devendra
varivari

 

 

this apex class and VF page 

values in the query are displayed in visualforce page on opportunity detail page.

when i click on campign it is opening in the page block. I want it to be opened in a new window

can u help 

 

Devendra@SFDCDevendra@SFDC

Hi,

 

Try to add Campaign.Name field inside a query for CampaignMembers.

 

<apex:pageBlockTable value="{!lstCampaignMember}" var="campaignMember" cellPadding="4" border="1">
	<apex:column> 
		<apex:outputLink value="/{!campaignMember.campaignId}" targer="_blank">
			{!campaignMember.Campaign.Name}
		 </apex:outputLink>
	</apex:column>
	<!-- Rest of the columns follows -->
</apex:pageBlockTable>

 

Thanks,

Devendra

 

 

This was selected as the best answer