You need to sign in to do that
Don't have an account?
AK_Smith
How to refresh the parent page after a Save action in a VF page in SF1
Hello! Please help me with the code below.
I created an action button that opens the VF page on SF1 record
After i hit SAVE button the VF page closes but values in Project__c.l__c/Project__c.ll__c stays the same (old)
I have to pull down the page to see the results.
how to automatically update the record window after clicking on the save button?
I created an action button that opens the VF page on SF1 record
After i hit SAVE button the VF page closes but values in Project__c.l__c/Project__c.ll__c stays the same (old)
I have to pull down the page to see the results.
how to automatically update the record window after clicking on the save button?
<apex:page standardController="Project__c" id="page" docType="html-5.0"> <script> geoFindMe() function geoFindMe() { var output = document.getElementById("out"); if (!navigator.geolocation){ output.innerHTML = "<p>Geolocation is not supported by your browser</p>"; return; } function success(position) { var latitude = position.coords.latitude; var longitude = position.coords.longitude; document.getElementById('page:form:lati').value = latitude.toString().replace(".",",") ; document.getElementById('page:form:long').value = longitude.toString().replace(".",",") ; document.getElementById('page:form:SF1').checked = true; }; function error() { output.innerHTML = "Unable to retrieve your location"; }; navigator.geolocation.getCurrentPosition(success, error); } </script> <apex:form id="form"> <div style="display:none;"></div> latitude :<apex:inputField id="lati" value="{!Project__c.l__c}" /> <br></br> longitude :<apex:inputField id="long" value="{!Project__c.ll__c}" /> <apex:inputField id="SF1" value="{!Project__c.SF1__c}" /> <apex:commandButton action="{!save}" value="Save"/> </apex:form> </apex:page>
From your code snippet,
Please try to replace this line:
with this line,
we can give target attribute to refresh our parent page.
If this helps you, please mark this answer as best
Regards
Suraj
It works, but open full page, not SF1
then, please try this, it may help you
use this code inside your script tag:
and plzz call this on your save action button:
Hope it will be helpful to refresh your SF1 page
Regards
Suraj
Done but it use cached page
Good Evening
I was searching for an issue which is almost similar to this issue.
I am using the below code for my Account - Competitor(Custom Object)..When I am adding new competitor and click on Save button, I have to manually refresh the page to see the changes and when I use the below code it is working fine but the Salesforce One is not working correctly.
<apex:commandLink value="Save" action="{!save}" target="_parent" styleClass="btn" onClick="refresh()">
and I have used the script code because we are using Salesforce one(Mobile App) as the sales users are using mobile for most of the time.
<script> function refresh(){ sforce.one.back(true); } </script>
My issue is when I am using this code ...
I am getting the page refreshed in the parent page (which is Account here and the child page as Competitor) but the Salesforce One is not working correctly.
Please let me know your thoughts