function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
ID id1 = ApexPages.CurrentPage().getParameters().get('id'); String sObjName = id1.getSObjectType().getDescribe().getName(); String query1 = 'select name from ' + sObjName + ' where id = :id1 limit 1'; SObject[] s = Database.query(query1); String name1 = ''; if(s.size()>0){ name1 = (String) s[0].get('name'); } System.debug(name1);
<apex:page Controller="Account">
<apex:form>
<apex:inputtext value="{!accountid}"/> <p/>
<apex:pageBlock title="My account detail">
<apex:pageBlockTable value="{!a}" var="item">
<apex:column value="{!item.number}"/>
<apex:column value="{!item.name}"/>
<apex:column value="{!item.phone}"/>
//other details depend on requirement
</apex:pageBlockTable
<apex:commandButton value="display" action="{!display}"/>
</apex:form>
</apex:page>
Controller:
Public class display details{
String accountid{get;set;}
List<Account> a{get;set;}
Public display details()
{
a=new <Account>();
}
Public void display()
{
a.clear();
Account b=[Select number,name,phone from Account where Accountid:accountid LIMIT 1];
a.add(b);
}
}
It is general just to give you idea i typed this code.use this as base code and change it according to your requirement
All Answers
Chek the below link.
http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_extension.htm
Please have a look at this link
http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_extension.htm
You can use the following sample code. Customize it for your own needs, and also add some exception handling.
<apex:page Controller="Account">
<apex:form>
<apex:inputtext value="{!accountid}"/> <p/>
<apex:pageBlock title="My account detail">
<apex:pageBlockTable value="{!a}" var="item">
<apex:column value="{!item.number}"/>
<apex:column value="{!item.name}"/>
<apex:column value="{!item.phone}"/>
//other details depend on requirement
</apex:pageBlockTable
<apex:commandButton value="display" action="{!display}"/>
</apex:form>
</apex:page>
Controller:
Public class display details{
String accountid{get;set;}
List<Account> a{get;set;}
Public display details()
{
a=new <Account>();
}
Public void display()
{
a.clear();
Account b=[Select number,name,phone from Account where Accountid:accountid LIMIT 1];
a.add(b);
}
}
It is general just to give you idea i typed this code.use this as base code and change it according to your requirement