+ Start a Discussion

When New Account Created- Can Save take users to Contact Edit page?


Any help is much appreciated.  I am trying to find ways to force users to add at least one Contact when an Account is created.  I have spent hours looking at other posts requesting similar code, but don't know enough to put it all together for this particular request.  Is there a way (Trigger or S-control or what) that will take users to the Contact Edit page after creating a New Account? In addition it would be nice to do this at the Opportunity level as well with making sure Contact roles are associated with an Opportunity.





Even better if can pre-populate some fields from Account to Contact but leave in edit mode for user to finish...


Thanks again.



Hi Liz,


Please do the following:


1. make a controller(extensions account)

2. create a button 'Save' on edit page of account. remove the original save button.

then on that(custom) save button..write a controller..and write the 'save' function of type 'PageReference' and then redirect that page to the new contact creation.


for your second post..u can declare objects for contact in ur constructor and assign whatever values u want..



Hope it helps..get back in case of any clarifications.. :)


Message Edited by crmexpert on 05-08-2009 04:36 AM

Thanks! That all sounds great except now I have to figure out how to do it! ha. I have figured out how to do some basic coding, but in general am just trying to learn it as I go.  I am not sure about step 1- make a controller. This is new to me. I kinda get steps 2 and 3 and have seen similar code on other posts.  Much appreciate your prompt response, and any additional guidance as well.




well for the first step..u cud refer to Visualforce Pages Developers Guide and easily make a controller class which is used to define how a visualforce page works..

follow the steps and you can surely do it