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
adi salesforceadi salesforce 

How to create a button newaccount when we click the button new account should be open.

SHAHNA MULLASHAHNA MULLA
Hi,

To do this, you may create a Detail page button and choose Behavior as URL and use the following code,
{!URLFOR( $Action.Account.New )}

This will ask you to select a record type if you want to set the default record type of the user, you may use Execute Javascript in Behaviour and use the following code:
window.open('/001/e');

Please see this link for additional details : https://help.salesforce.com/articleView?id=defining_custom_links.htm&type=5

Can you please Let me know if it helps or not!!!

If it helps don't forget to mark this as a best answer!!!

 
SHAHNA MULLASHAHNA MULLA
Hello,

Are you looking for a VFP, to do the action. Then try following code,
<apex:page standardController="Account">
    <apex:form >
        <apex:pageBlock >    
                    <apex:commandButton value=" Newaccount " onclick="window.open('/001/e')"/>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 
Bhargavi TunuguntlaBhargavi Tunuguntla
Hi

You can use Java script to apply the action as below:

/001/e append this to your base URL and thiis will work fine.If you have any recordtypes we can even pass record typeid the specify as :  &RecordType=ID.

Thanks
Bhargavi.