function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dave StevensonDave Stevenson 

Why is quicksave listed in some documents but not others?

Why is quicksave listed in the VisualForce Developer Guide under "Using Standard Controller Actions", but not under "StandardController Methods" in either the VisualForce Developer Guide or the Apex Developer Guide?
SandhyaSandhya (Salesforce Developers) 
Hi David Stevenson,

As per my knowledge, Controller action methods are supported by all standard controllers. You can associate these actions with any Visualforce component that includes an action attribute.

These methods can be directly used in Visual force page with ! notation.
 
<apex:commandButton action="{!save}" value="Save"/>

Action methods perform logic or navigation when a page event occurs, such as when a user clicks a button or hovers over an area of the page. Action methods can be called from page markup by using {! } notation in the action parameter.

Standard controller methods must be called with the instance as they are instance methods.These have a return type.

These methods are  used in Apex controller as below

public System.PageReference save()

Hope this helps you!

Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution.
 
Thanks and Regards
Sandhya




 
Dave StevensonDave Stevenson
Thanks for your reply, but I asked about quicksave, not save. I am also wondering about CloseCase.

If I can use standard controller actions like quicksave and CloseCase in a Visualforce page:
<apex:commandButton action="{!CloseCase}" value="Close"/>
<apex:commandButton action="{!quicksave}" value="Save"/>
can I also call them from my controller extension?:
public with sharing class CaseControllerExtension {
	private final ApexPages.StandardController sC;
	public CaseControllerExtension(ApexPages.StandardController stdCtlr) {
		sC = stdCtlr;
	}
	public PageReference saveAndClose() {
		sC.quicksave();
		return sC.CloseCase();
	}
}

If I can, then why are quicksave and closeCase not listed as controller methods in the documentation?
SandhyaSandhya (Salesforce Developers) 
Hi David Stevenson,

I may not have conveyed you properly.

I am not aware of closecase() anywhere as in action method or standard controller method.

But yes you can use the 
<apex:commandButton action="{!quicksave}" value="Save"/>
But you cannot use the
public PageReference saveAndClose() {
		sC.quicksave();

Instead you can use
 
public PageReference saveAndClose() {
		sC.save();
That means  save() is instance method and also action method so we can use in visual force page as well as controller method.

But quicksave is only action method, and that can be used only in visual force page.It cannot be used in the controller because that is not an instance method.

In simple words, controller action methods are used in visual force page, and controller instance methods are used in the controller.

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_std_actions.htm

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/apex_ApexPages_StandardController_methods.htm

Thanks and Regards
Sandhya
Dave StevensonDave Stevenson
Is quicksave an action method? How can you tell? Can you see the source code for the method? If it is an action method, why is it impossible to call it like other methods?:
        sC.quicksave();
-> Save error: Method does not exist or incorrect signature: [ApexPages.StandardController].quicksave()
'Method does not exist' makes me think it is not a method at all. But if an action is not a method, then what is it? The absence of detailed documentation makes it difficult for me to understand precisely how actions fit into the architecture, and how I can use them.

It seems to me that salesforce uses a bit of hand waving while saying "This is an action", as though the gestures make it more clear. At least for the weak-minded who are susceptible to hand waving: "These are not the droids you're looking for."

Of course, using sC.save() will get me the first half of saveAndClose(). But how would I get the second part?:
public PageReference saveAndClose() {
		sC.save();
		return sC.CloseCase();
	}
-> Save error: Method does not exist or incorrect signature: [ApexPages.StandardController].CloseCase()
If only I had studied Jedi hand gestures in school, the salesforce documentation might make more sense to me.