I'm having an inline visualforce page (to load a map) within a section of page layout. My requirement is to update a field in the same record once the page is loaded. I have the inline VF page and the standard controller. I had an action function on Apex page to update the value. It works perfectly, but it doesn't display the updated value in the layout. It has to be refreshed to load the value. I tried to use an ActionFunction within Apex:Form. But looks like it doesn't trigger the Action method (No debug). Here's the code
<apex:actionFunction name="updateDistance" action="{!updateRec}" rerender="mainMap" status="myStatus">
and my actionmethod is,
public PageReference updateRec(){
try{
system.debug('sId::'+sId);
if (sId != NULL && sId != ''){
custom__c Rec = new custom__c(Id=sId);
Rec.field__c = value;
upsert Rec;
}
}catch(DMLException dme){
system.debug('Exception dme:::'+dme.getMessage());
return null;
}
return null;
}
Anyone can suggest a workaround for this?