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
DelmDelm 

Displaying updated records in visualforce

Hi,

I am trying to create a program in visualforce with ajax tool. The program will update the record before viewing its details. Here is my sample code:

<apex:page standardController="ObjectTest__c" >
<script src="/soap/ajax/15.0/connecton.js" type="text/javascript"></script>
<script src="/soap/ajax/15.0/apex.js" type="text/javascript"></script>
<script>
sforce.connection.sessionId = "{!$Api.Session_ID}";
var u = new sforce.SObject("ObjectTest__c");
u.Id = "{!ObjectTest__c.Id}";
u.Field_To_Update__c = 'Hello';
result = sforce.connection.update([u]);
</script>
<apex:detail relatedList="true" />

</apex:page>

The problem is, although the update has been made, it display the un-updated data. I have to view again the page inorder to see the update.

Question, how can I achieve displaying the detail page with the updated data without reloading the page?