On my VF page when I click on 'submit' button, I have pop-up with confirmation message. Then after clicked 'OK' button on this pop-up, I am redirected to the created record. Things are ok at this stage. Now I want conditional redirection when i'm in Classic or in Console mode. Actually when redirect to Console Mode I can't figure how to not display header and sidebar.
Thanks for any support/advice.
Below the codes :
Archive file
function parseSapExpressOrderResponse(obj,id){
if (obj.ErrorLines && obj.ErrorLines.length > 0) {
var s = ''; for (var i = 0; i < obj.ErrorLines.length; ++ i) s += '\n\t' +
obj.ErrorLines [i].Message
alert(orderError + s);
normalCursor ();
}
else {
alert(orderSuccess + obj.PurchaseNumber__c);
window.location = '/'+id;
}
VF page
<apex:actionFunction name="validateExpressOrder" action="
{!validateExpressOrder}" rerender="messages,hiddenParams"
oncomplete="SForderCreated();" >
<!-- <apex:param name="jsonparam" value="{!jsonparam}" /> -->
</apex:actionFunction>
</apex:PageBlock> <!-- class="globalSection" -->
</div>
</apex:form>
<script type="text/javascript" src="{!URLFOR($Resource.ExpressOrderJS)}"
/>
</apex:page>
Best Answer
When you are in console mode you can check
sforce.console.isInConsole()
using Salesforce Console Integration Toolkit.In your case, I hope this blog post will help.
How to open a new record inside a console in SubTab by inline visual force page