+ Start a Discussion
Alejandro Gonzalez 18Alejandro Gonzalez 18 

How to Autosave and refresh from VisualForce when Using a picklist and other formulas

The scenario is simple . 
I have an opject with a MasterDetail Relation to Opportunities. And I want to Display on To display on the edit screen the Account Name that is tied to the opportunity.

So I have
<apex:pageBlockSection title="Opportunity Information">
               <apex:inputField id="opportunity" value="{!Item.Opportunity__c}" />
              <apex:outputField  id="accountName" value="{!Item.Account_Name__c}"/>


very simple.
What I want is when the user Selects the opprtunity, I want all the formula fields to refresh. This formula fields basicall expose properties of the Account Object.

I dont mind saving the object, since i am going to use a status of 'Incomplete'
public CustomObject getItem() 
        if(item == null) 
            item = new CustomObject ();
            item.Application_Status__c = 'Incomplete';
        return item;

So any ideas? I read something about saving it via JS, but how do Ido it?
Best Answer chosen by Alejandro Gonzalez 18

All Answers

Naval Sharma4Naval Sharma4
This was selected as the best answer
Alejandro Gonzalez 18Alejandro Gonzalez 18
Thanks. I was able to dynamically refresh the fields using the action region