You need to sign in to do that
Don't have an account?

Creating new object from Related List
Hi
I'm facing a problem which I haven't found how to overcome:
I have two custom objects, these objects have a lookup relationship and therefore can be created from the corresponding related list on the lookup object object.
My problem is that for custom object AAA, when I create new (through the Related List) the save action takes me back to the Related List (on the Object page) but for the custom object BBB, after save I get the page showing me the object I just created (Details Page).
I want to achieve the first behavior, and I was told that because object BBB has a Recod Type (which I select first thing when I create the object) I get the second behavior.
Its really importent for me to achive the first behavior for both.
Any idea how to work around this?
Thanks
Hi,
the navigation behavior can be overriden using visualforce pages and button overrides.
To change the new functionality go to the object's config page and change the New standard button to the following visualforce page (assuming your custom object name will be testnewfromrellist__c and has lookups to Account and Job Application custom object - please change as needed):
The extension code looks like this:
The code changes the behavior of the save method by redirecting him/her to the parent record. It leverages the cancel action which takes back to the previous screen when the user hits cancel. I believe this is what you want to do.
In this regard you will have to override the new button.
Asn on save you will have to write save method like as:
public PageReference save() {
Id AAAID='BVKJBGKJ447476vnj';
PageReference pageRef = new PageReference('/' + AAAID);
pageRef.setRedirect(true);
return pageRef;
}
Thank you very much
Is there any way to avoid writing a new page?
I really like the way the standard page is working, the behavior on Save is the only thing I want to change
Thanks a lot