1

I am trying to find a way to direct a user to the New Contact page automatically when a new account is created. I was thinking of using a VF page which overrided the edit on an account. The page would determine whether a new account had been created (I am assuming by looking at whether the created date is the same as current date or is there a better way?) and then if it is redirecting them to a new contact page, otherwise just go to the standard account view page.

Is there a better way to do this? Perhaps Visual Workflow? I do not know much about it and was wondering of that would be a better alternative.

Does anyone know what is a best practice regarding doing this?

1 Answer 1

1

I am not quite sure about visual workflow. But one approach I can think of is using a particular record type just for creating new account. And trigger will change the record type once it is created. On the layout of the "new" record type you can have a custom button will direct to new contact page. Does that sound good to you?

Besides, if you want to do that via VF page, I don't see any reason you want to check created date to current date. You can simply pass a parameter to your visualforce page to tell you whether it is new or edit and redirect to different pages according to it.

6
  • Thanks for the response, but I am not sure how a record type with a button would help route them automatically to the new contact page when a new account is saved. Commented Nov 12, 2014 at 0:40
  • @SaraMorgan Define a custom button and let it do the save process and point to the new contact page. Place it only in your new record type's layout, name it create or something. For other record types, just use the normal save button.
    – Lance Shi
    Commented Nov 12, 2014 at 1:27
  • Lance, I think my lack of knowledge of record types is killing me here and I apologize. I was under the impression that I could assign different record types to different profiles, which I understand. But, how do I specify that a certain record type is used only when creating a new account? I realize if there are multiple record types, then the first one is used when creating a new record, but once that record is created with that record type, won't it always use that record type (even when doing an edit)? That is the part I do not get with your proposed solution. Commented Nov 12, 2014 at 15:51
  • perhaps there is just some setting in Salesforce regarding record types that I am unaware of? All I see is the ability to assign record types to certain profiles. Sorry if I am asking an obvious question. Commented Nov 12, 2014 at 15:53
  • Hi Lance, I think I got it figured out now and I do see that the record type is the best solution for this. I always try to look for a declarative solution first and I knew that there had to be a way to do this without the need for more code. Thanks for pointing me in the right direction. Commented Nov 12, 2014 at 21:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .