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
Eric VitucciEric Vitucci 

Visualforce Knowledge form opening case record not staying on Form.

I have created a form in the Salesforce Support console that updates knowledge fields when you push the save button. This all works perfectly. However after you hit save the visualforce page changes to the Case Record in the small area the form was. I would like it to stay on the form and not change after the save button is push. I am not sure how I do this.

<apex:page showHeader="false" standardStylesheets="false" standardController="Case" pageStyle="Left"> <style> p.small { line-height: 0.5; } </style> <font face = "Arial" align="left" style="font-size:11px" color="454545"> <table style="width:100%"> <apex:form > <apex:pageBlock > <apex:pageBlockSection columns="1"> <apex:commandButton action="{!save}" value="Save" id="theButton"/> <apex:inputField value="{!Case.Steps__c}"/> <apex:inputField value="{!Case.Environment__c}"/> <apex:inputField value="{!Case.Additional_Information__c}"/> <apex:inputField value="{!Case.Answer__c}"/> </apex:pageblocksection> </apex:pageBlock> </apex:form> </table> </font> </apex:page>
 
Best Answer chosen by Eric Vitucci
Aman MalikAman Malik
Hi Eric,

Instead of using standard save action, use quicksave. This would not let you go to detail page. Therefore update your commandbutton like below:
<apex:commandButton action="{!quicksave}" value="Save" id="theButton"/>
Hope this will help.

Please like the answer and mark it as best if this helps.

Thanks,
Aman
 

All Answers

Nikhil Verma 6Nikhil Verma 6
Hi Eric,
Instead of the commandButton, use commandlink to initate Save action. You can use this as follows:
<apex:commandLink action="{!save}" value="Save" id="theButton" styleClass="btn"/>

Since, Save is a standard method, so the page automatically assumes that the entire frame needs to be rendered as the record detail page. Making this a link works in most of the cases. Using the styleClass="btn" gives the link button-type look and feel.

Hope this helps.
Eric VitucciEric Vitucci
Thanks Nikhil, 

That doesn't seem to work still opens to the case. I also tried this and it doesn't work either.

<apex:commandLink action="{!save}" value="Save" id="theCommandLink"/>

So I am not sure what to do here.
Aman MalikAman Malik
Hi Eric,

Instead of using standard save action, use quicksave. This would not let you go to detail page. Therefore update your commandbutton like below:
<apex:commandButton action="{!quicksave}" value="Save" id="theButton"/>
Hope this will help.

Please like the answer and mark it as best if this helps.

Thanks,
Aman
 
This was selected as the best answer
Eric VitucciEric Vitucci
Thanks Aman - that did it!