You need to sign in to do that
Don't have an account?
Ajay Kumar 583
To add Visual Force Page code
Hi , i have created a Button on Account object and Now i need to add the visualforce page code Which will create a Contact when the user clicks the button. How to do it
Please create a vf page and its controller .
then add vf page in the button as given Screenshot
Thanks,
I need vf page and its controller Code to create contact on Account object.
Thanks
Greetings to you!
Below is the sample code which I have tested in my org and it is working fine. Kindly modify the code as per your requirement.
Visualforce:
Controller:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
I am getting below error:
Insert failed. First exception on row 0 with id 0032v00002pPocnAAC; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]
And i dont want the page to render. Button should automatically create a custom contact without giving the page.
Thanks,
Ajay