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
Padmanabhan KamuniPadmanabhan Kamuni 

Kindly help me in creating this Task

Create a new VisualForce Page, such that the page enables creation of a new Lead
when inserted, the details should be displayed in a new page, that means the record detail page should open in a new tab/page
the page should be reloaded with the detail page.
RKSalesforceRKSalesforce
Hello Padmanabhan,

Please use below code: 
<apex:page standardController="Lead">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:inputField value="{!lead.FirstName}"/>
                <apex:inputField value="{!lead.LastName}"/>
                <apex:inputField value="{!lead.Company}"/>
            </apex:pageBlockSection>
            <apex:commandButton id="saveBtn" value="Save" action="{!save}" />
        </apex:pageBlock>
    </apex:form>
</apex:page>
Please let me know if you have any question. Please mark best answer if helped for others help.

Regards,
Ramakant​
Padmanabhan KamuniPadmanabhan Kamuni
Hello Ramakant,
Thank you for your swift response.
The above code doesn't go to details page in New Tab or New Page. Kindly you assist me.
RKSalesforceRKSalesforce
Hello,

Please use below code:
<apex:page standardController="Lead" >
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:inputField value="{!lead.FirstName}"/>
                <apex:inputField value="{!lead.LastName}"/>
                <apex:inputField value="{!lead.Company}"/>
            </apex:pageBlockSection>
            <apex:pageBlockButtons >
            <apex:commandLink value="Save" action="{!save}" styleClass="btn" 
                target="_blank" style="text-decoration:none" />            
        </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>
Please let me know if you have any question. Please mark best answer if helped for others help.

Regards,
Ramakant​