• Serhat Aygün
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
hi all,

I have overridden View button in a custom object, so whenever I click on a record in SF1 list view, a visualforce page is called which executes a callout to an external system and populates all the fields of the record before navigating to the detail page of it. The problem is that, when I click on the back button (top left corner of screen), I go to the visualforce page again, and I become stuck at "Please Wait" statement which it displays. My intent is to navigate back to the list view directly from the detail page, skipping the visualforce page.

I tried putting a sforce.one navigation element that redirects to the list above the sforce.one.navigateToURL but I couldn't get it to work. Anyone else got any other ideas on how I can overcome this issue?
 
<apex:page StandardController="PR_PO_Approvals__c" extensions="WSPRPOApprovals">
  <apex:form>
           <h1>Please wait...</h1>
           <apex:actionFunction name="CallDetailPRApexMethod" action="{!GetDetailPR}"
                            oncomplete="Call('{!ErrorMsg}');"/>
           <apex:actionFunction name="CallDetailPOApexMethod" action="{!GetDetailPO}"
                            oncomplete="Call('{!ErrorMsg}');"/>
 </apex:form>
<script type="text/javascript">
    try 
    {
        if ('{!PR_PO_Approvals__c.RecordType.DeveloperName}' == 'PR_LineItem'){
            CallDetailPRApexMethod();}
        else {
            CallDetailPOApexMethod();}
    } 
      catch(e) { 
      alert(e);
}
function Call(a)
{
 
    if(a)
    {
        alert (a);
    }

        if((typeof sforce != 'undefined') && sforce && (!!sforce.one)) 
        {

            sforce.one.navigateToURL('/{!PR_PO_Approvals__c.Id}?nooverride=1');
            
        }
        else 
        {          
            window.location.href = '/{!PR_PO_Approvals__c.Id}?nooverride=1';                                          
        }
          
}
</script>
</apex:page>
hi all,

I have overridden View button in a custom object, so whenever I click on a record in SF1 list view, a visualforce page is called which executes a callout to an external system and populates all the fields of the record before navigating to the detail page of it. The problem is that, when I click on the back button (top left corner of screen), I go to the visualforce page again, and I become stuck at "Please Wait" statement which it displays. My intent is to navigate back to the list view directly from the detail page, skipping the visualforce page.

I tried putting a sforce.one navigation element that redirects to the list above the sforce.one.navigateToURL but I couldn't get it to work. Anyone else got any other ideas on how I can overcome this issue?
 
<apex:page StandardController="PR_PO_Approvals__c" extensions="WSPRPOApprovals">
  <apex:form>
           <h1>Please wait...</h1>
           <apex:actionFunction name="CallDetailPRApexMethod" action="{!GetDetailPR}"
                            oncomplete="Call('{!ErrorMsg}');"/>
           <apex:actionFunction name="CallDetailPOApexMethod" action="{!GetDetailPO}"
                            oncomplete="Call('{!ErrorMsg}');"/>
 </apex:form>
<script type="text/javascript">
    try 
    {
        if ('{!PR_PO_Approvals__c.RecordType.DeveloperName}' == 'PR_LineItem'){
            CallDetailPRApexMethod();}
        else {
            CallDetailPOApexMethod();}
    } 
      catch(e) { 
      alert(e);
}
function Call(a)
{
 
    if(a)
    {
        alert (a);
    }

        if((typeof sforce != 'undefined') && sforce && (!!sforce.one)) 
        {

            sforce.one.navigateToURL('/{!PR_PO_Approvals__c.Id}?nooverride=1');
            
        }
        else 
        {          
            window.location.href = '/{!PR_PO_Approvals__c.Id}?nooverride=1';                                          
        }
          
}
</script>
</apex:page>