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
khushbu dubeykhushbu dubey 

is it correct code?

<apex:page standardController = "lead">
<apex:pageBlock>
<apex:pageBlockSection title= "lead inform" columns= "1">
<apex:outputField value= "{!lead.Campaign.Name}"/>
<apex:outputField value= "{!lead.annualrevenue}"/>
<apex:outputField value= "{!lead.address}"/>
<apex:outputField value= "{!lead.donotcall}"/>
<apex:outputField value= "{!lead.email}"/>
</apex:pageBlockSection>
 </apex:pageBlock>
</apex:page>

 
Amit Chaudhary 8Amit Chaudhary 8
Please check below post to see Lead object API Name.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_lead.htm

Please change you code like below
<apex:page standardController="lead" >
<apex:pageBlock >
<apex:pageBlockSection title="lead inform" columns="1">
<apex:outputField value="{!lead.annualrevenue}"/>

<apex:outputField value="{!lead.Street}"/>
<apex:outputField value="{!lead.State}"/>
<apex:outputField value="{!lead.City}"/>
<apex:outputField value="{!lead.Country}"/>
<apex:outputField value="{!lead.PostalCode}"/>

<apex:outputField value="{!lead.donotcall}"/>
<apex:outputField value="{!lead.email}"/>
</apex:pageBlockSection>
 </apex:pageBlock>
</apex:page>

I see you are doing same mistake again and again for field API name on VF page. Please try below code to get All object API.
http://amitsalesforce.blogspot.in/2015/11/apex-describe-dynamic-retrieval-of.html
 
public with sharing class DescibeDemoController 
{
    public Map <String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
    public String selectedObject {get; set;}
    public List<FieldWrapper> listField{get;set;}

    public DescibeDemoController() 
    {
        listField = new List<FieldWrapper>();
    }

    // find all sObjects available in the organization
    public  List<SelectOption> getListObejectName() 
    {
        List<SelectOption> objNames = new List<SelectOption>();
        List<String> entities = new List<String>(schemaMap.keySet());
        entities.sort();
        for(String name : entities)
            objNames.add(new SelectOption(name,name));
        return objNames;
    }

    
    // Find the fields for the selected object
    public void showFields() 
    {
        listField.clear();
        Map <String, Schema.SObjectField> fieldMap = schemaMap.get(selectedObject).getDescribe().fields.getMap();
        for(Schema.SObjectField sfield : fieldMap.Values())
        {
            schema.describefieldresult dfield = sfield.getDescribe();
            FieldWrapper wObj = new FieldWrapper();
            wObj.fieldName = dfield.getLabel ();
            wObj.fieldAPIName = dfield.getname();
            listField.add(wObj);
        }
    }

    public class FieldWrapper
    {
        public String fieldName {get; set;}
        public String fieldAPIName {get; set;}
    }

}
<apex:page controller="DescibeDemoController">
    <apex:form id="Describe">
        <apex:pageBlock id="block2" >
            <apex:pageblockbuttons location="top" >
                    <apex:commandButton value="Show Fields" action="{!showFields}" />
            </apex:pageblockbuttons>
            
            <apex:pageblocksection >
                <apex:pageBlockSectionItem >
                    <apex:outputLabel >Object Name</apex:outputLabel>
                    <apex:selectList value="{!selectedObject}" size="1">
                        <apex:selectOptions value="{!ListObejectName}"/>
                    </apex:selectList>
                </apex:pageBlockSectionItem>
            </apex:pageblocksection>
        </apex:pageBlock>
        
        <apex:pageBlock id="result" title="Field Detail for {!selectedObject}" rendered="{!if(listField.size > 0 ,true,false)}"   >
            <apex:pageBlockTable value="{!listField}" var="field" rendered="{!if(listField.size > 0 ,true,false)}"> 
                <apex:column value="{!field.fieldName }" headerValue="Name" />
                <apex:column value="{!field.fieldAPIName }"  headerValue="API Name"/>
            </apex:pageblockTable>
        </apex:pageblock>
    </apex:form>
</apex:page>
Let us know if this will help you

Thanks
Amit Chaudhary