+ Start a Discussion
vamsi varmavamsi varma 

save and new action in visualforce

i have a vf page, that is invoked when new contact button in account page is used.
in that vf page i have save and new button.
that button when we pressed it.
It should save and redirect to same vf page with account id same as previous one.
can anyone implement this and let me know.
thanks in advance,
Suraj PSuraj P
Pass the Account Id as a page Param going from the Account VF Page to the new Contact VF Page. Then, in the save and new button's action method on the new Contact page, put this code at the end

PageReference pr = Page.AccountVFPage;
return pr;
Krishna SambarajuKrishna Sambaraju
Hi Vamsi,

What is the reason for creating a custom visualforce page for creating new contact, when you can do it with the standard functionality on the Account page layout?

vamsi varmavamsi varma

I want to skip recordtype selection page.
i have done that succesfully.
thanks suraj.

vamsi varmavamsi varma

i have one more question when this is done from account page layout it is going good.
but when i create new contact from contact tab , we dont have any kind of account .

but my intention is to select record type on account basis.

so if i select account there the vf page should refresh based on that.

can anyone help me on this issue....?
thanks in advance.

Suraj PSuraj P
If my answer helped, please mark it as the best answer. Thanks