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
XIOXIO 

Help with visualforce Page in Lightning - needs to stay in the same tab after save

Hello,

We have a visualforce page called Safesend Returns in a Lightning tab. When we hit save it redirects to the Details tab. Is there a way to make the visualforce page stay in the Safesend Returns tab after save?

User-added image


Visualforce Page
<apex:page standardController="Account" lightningStylesheets="true">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection columns="2">
            


<apex:outputField value="{!Account.TaxSoftware__c}">  
<apex:inlineEditSupport event="ondblclick" /> 
</apex:outputField>

<apex:outputField value="{!Account.Est_of_tax_returns__c}">  
<apex:inlineEditSupport event="ondblclick" /> 
</apex:outputField>

<apex:outputField value="{!Account.SSR_Demo__c}">  
<apex:inlineEditSupport event="ondblclick" /> 
</apex:outputField>

<apex:outputField value="{!Account.of_1040s__c}">  
<apex:inlineEditSupport event="ondblclick" /> 
</apex:outputField>

<apex:outputField value="{!Account.SSR_Total_Revenue__c}">  
<apex:inlineEditSupport event="ondblclick" /> 
</apex:outputField>

<apex:outputField value="{!Account.of_1041s__c}">  
<apex:inlineEditSupport event="ondblclick" /> 
</apex:outputField>

<apex:outputField value="{!Account.SSR_Opportunity_Date__c}">  
<apex:inlineEditSupport event="ondblclick" /> 
</apex:outputField>

<apex:outputField value="{!Account.of_1120__c}">  
<apex:inlineEditSupport event="ondblclick" /> 
</apex:outputField>

<apex:outputField value="{!Account.SSR_Original_Purchase_Date__c}">  
<apex:inlineEditSupport event="ondblclick" /> 
</apex:outputField>

<apex:outputField value="{!Account.of_1120S__c}">  
<apex:inlineEditSupport event="ondblclick" /> 
</apex:outputField>

<apex:outputField value="{!Account.SSR_Client_Status__c}">  
<apex:inlineEditSupport event="ondblclick" /> 
</apex:outputField>

<apex:outputField value="{!Account.of_1065s__c}">  
<apex:inlineEditSupport event="ondblclick" /> 
</apex:outputField>

<apex:outputField value="{!Account.SSR_Next_Steps__c}">  
<apex:inlineEditSupport event="ondblclick" /> 
</apex:outputField>

<apex:outputField value="{!Account.Verified_of_Returns__c}">  
<apex:inlineEditSupport event="ondblclick" /> 
</apex:outputField>

            </apex:pageBlockSection>
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Save"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 
Best Answer chosen by XIO
Sam KesslerSam Kessler
Hey XIO,
I would recommend simply using the "quicksave" action in your commandbutton instead of "save" - it's designed to save the current status of your page without closing or redirecting.

If you're feeling squirrely you could also write a quick controller extension class and define a custom save action that could let you access some more highly customized functionality, such as showing custom page messages, but that might not be worth your time if all you're looking to do is quickly save a record.
Hope this helps!

All Answers

Sam KesslerSam Kessler
Hey XIO,
I would recommend simply using the "quicksave" action in your commandbutton instead of "save" - it's designed to save the current status of your page without closing or redirecting.

If you're feeling squirrely you could also write a quick controller extension class and define a custom save action that could let you access some more highly customized functionality, such as showing custom page messages, but that might not be worth your time if all you're looking to do is quickly save a record.
Hope this helps!
This was selected as the best answer
XIOXIO
Thank you, Sam Kessler!!