You need to sign in to do that
Don't have an account?
learning1.3953795511514497E12
override the standard save button in salesforce
I have a requirement where i need to customize the Account's "save" button in VF page. The save button should do the following.
1 : Save the record and go to that particular record's view page. (This is standard functionality)
2 : Get the record id from the url in addressbar.
I need the record id to create related list records for this particular Account.
OR
Is there any way to create the Account record and its child records at a time?
I should not create the related list records manually since the data is coming from external entity.I just need to dump that data to the related list .So I have to go through the above method only.
I have tried the below code but no luck...
In VF page
----------------
<apex:commandButton value="Save" action="{!SaveAndCreteLocations}"/>
In APex controller :
-------------------------------
public pageReference SaveAndCreteLocations()
{
pageReference pv = controller.view();
controller.save();
pv.setRedirect(true);
return pv;
}
In the above code the record is saving but not going to the view page.
Please help...
1 : Save the record and go to that particular record's view page. (This is standard functionality)
2 : Get the record id from the url in addressbar.
I need the record id to create related list records for this particular Account.
OR
Is there any way to create the Account record and its child records at a time?
I should not create the related list records manually since the data is coming from external entity.I just need to dump that data to the related list .So I have to go through the above method only.
I have tried the below code but no luck...
In VF page
----------------
<apex:commandButton value="Save" action="{!SaveAndCreteLocations}"/>
In APex controller :
-------------------------------
public pageReference SaveAndCreteLocations()
{
pageReference pv = controller.view();
controller.save();
pv.setRedirect(true);
return pv;
}
In the above code the record is saving but not going to the view page.
Please help...
If this helps,please mark this as best answer to help others :)
All Answers
If this helps,please mark this as best answer to help others :)
Thanku soo much... :)
It worked ...