You need to sign in to do that
Don't have an account?
Tillu
How to display object records on button click ?
I want to display all opportunities records in new window on button click on contact page. it is like all related to contact opportunities should need to be visible. Can any one help pls
Use the code,
visualforce:
<apex:page standardController="Contact" extensions="test">
<apex:form >
<apex:pageblock >
<apex:pageblockTable value="{!olist}" var="a">
<apex:column value="{!a.name}"/>
<apex:column value="{!a.stagename}"/>
</apex:pageblockTable>
</apex:pageblock>
</apex:form>
</apex:page>
controller:
public class test
{
public opportunity opp{get;set;}
public list<Opportunity> olist {get;set;}
public string ids;
public account acc;
public test(ApexPages.StandardController controller)
{
Contact con = (Contact)controller.getRecord();
contact c1 = [select id , accountId from Contact where id =: con.id];
ids = c1.accountId;
olist = new list<opportunity>([select id, name, stagename from opportunity where AccountId =: ids]);
}
}