You need to sign in to do that
Don't have an account?
h8r41d
Custom button javascript for conditional redirect after save operation
Hey guys, I have a question about javascript and custom buttons.
Basically, on a standard layout (NOT visualforce), I need a custom Save button that will perform the standard save operation, but instead of redirecting, will display a prompt asking the user if they want to add a related record. If so, redirect to the create new page, otherwise, go to the regular detail page.
Can somebody point me in the right direction for how to get started on something like this? Any examples available?
I'm looking into using Javascript remoting.
Can you tell me if I can make calls to the current standard controller with the Ajax library?
I've seen a lot of examples of calling custom apex controller methods.
I'm trying to figure out if I can access anything in the current stanardcontroller. Perhaps there's a way to call the save method from JS?
If not I suppose I'll have to replace the whole standard layout with visualforce.
Take a look at the apex:detail component - that uses the standard page layout for the record and record type in question, but inside a VF page.
The AJAX library is a bit fuzzy for me, I'm still trying to figure out what I can and can't do with it.