Activity Forums Salesforce® Discussions Unable to see the inserted record without refreshing the detail page of a Salesforce Opportunity

  • Manpreet

    Member
    April 25, 2018 at 10:35 am

    Hi Aman,

    It is a known issue to salesforce and possible it will be fixed in next few releases.As an alternative you can do the following :
    VISUALFORCE PAGE :
    -------------------

    <apex:page showHeader="true" standardController="Account" extensions="AccountController" sidebar="true">

    <script type='text/javascript' src='/canvas/sdk/js/publisher.js'/>
    <script src="https://mobile1.t.salesforce.com/soap/ajax/30.0/connection.js" type="text/javascript" />
    <script>
    function UpdateYourAcc() {
    var accountId = document.getElementById('accountId').value;
    Visualforce.remoting.Manager.invokeAction(
    '{!$RemoteAction.AccountController.accountUpdateNumberField}', accountId,
    function(result, event)
    {
    //if(result!=null) sforce.one.navigateToSObject(result,"detail");
    Sfdc.canvas.publisher.publish({name: "publisher.close", payload:{ refresh:"true"}});
    });
    }
    </script>
    <input type="text" name="name" id="accountId" value="{!viewState.accountId}"/>
    <a href="#" data-role="button" class="updateNotify" id="sendInvoicesMyself" onclick="UpdateYourAcc()">Update Account</a>
    </apex:page>

    Thanks.

  • Aman

    Member
    April 26, 2018 at 7:40 am

    Hi Manpreet,

    I have tried the above script. It is not working and and it is making the existing popup blank. Also, using the above script i am unable to navigate to record Detail page. I am using a lightning component inside a visualforce page. Below are some other script that i have tried but none of them work out if you have some other solution, please let me know

    1. $A.get('e.force:refreshView').fire();
    2. window.opener.location.reload(true);
    3. setTimeout(function(){ console.log('IntimeOut:::'+Get_getUITheme);window.location.reload(true);
      }, 5000);
    4. window.loadend = refreshParent;
      function refreshParent() {
      console.log("load event detected!");
      window.location.reload();
      }
    5. window.location.href = window.location.href;
      window.location.reload(true);

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos