You need to sign in to do that
Don't have an account?
Charline Mitchener
command button to save changes not working
I have created a vf page for Communities that allows a user to view their contact & account details and update them as needed. However, the command save button doesn't seem to work and the updates are not changes.
Anyone have any idea why? The community user has edit/read/write permissions on Accounts & Contacts.
Below is the VF Code -
<apex:page Controller="MyContactController">
<apex:form >
<apex:pageBlock title="Update Company Details for {!$User.CommunityNickname}">
<apex:pageMessages />
<apex:pageBlockSection >
<apex:inputField id="title" value="{!contact.title}" />
<apex:inputField id="firstname" value="{!contact.firstname}" />
<apex:inputField id="lastname" value="{!contact.lastname}" />
<apex:inputField id="email" value="{!contact.email}" />
<apex:inputField id="mobilephone" value="{!contact.mobilephone}" />
<apex:inputField id="Publish_Mobile_No_on_Website__c" value="{!contact.Publish_Mobile_No_on_Website__c}" />
<apex:inputField id="Website_Bio__c" value="{!contact.Website_Bio__c}" />
<apex:inputField id="Specialty__c" value="{!contact.Specialty__c}" />
<apex:inputField id="Qualifications__c" value="{!contact.Qualifications__c}" />
<apex:inputField id="photo__c" value="{!contact.Photo__c}" />
<apex:inputField value="{!contact.account.phone}"/>
<apex:inputField value="{!contact.account.fax}"/>
<apex:inputField value="{!contact.account.Website_Info__c}"/>
<apex:inputField value="{!contact.account.Nominated_Email_Contact_Website__c}"/>
<apex:inputField value="{!contact.account.Company_Logo__c}"/>
<br><br></br></br>
<apex:commandButton action="{!save}" value="Save" id="theButton" immediate="true"/>
</apex:pageBlockSection>
<apex:pageBlockSection >
<em>
</em>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
Anyone have any idea why? The community user has edit/read/write permissions on Accounts & Contacts.
Below is the VF Code -
<apex:page Controller="MyContactController">
<apex:form >
<apex:pageBlock title="Update Company Details for {!$User.CommunityNickname}">
<apex:pageMessages />
<apex:pageBlockSection >
<apex:inputField id="title" value="{!contact.title}" />
<apex:inputField id="firstname" value="{!contact.firstname}" />
<apex:inputField id="lastname" value="{!contact.lastname}" />
<apex:inputField id="email" value="{!contact.email}" />
<apex:inputField id="mobilephone" value="{!contact.mobilephone}" />
<apex:inputField id="Publish_Mobile_No_on_Website__c" value="{!contact.Publish_Mobile_No_on_Website__c}" />
<apex:inputField id="Website_Bio__c" value="{!contact.Website_Bio__c}" />
<apex:inputField id="Specialty__c" value="{!contact.Specialty__c}" />
<apex:inputField id="Qualifications__c" value="{!contact.Qualifications__c}" />
<apex:inputField id="photo__c" value="{!contact.Photo__c}" />
<apex:inputField value="{!contact.account.phone}"/>
<apex:inputField value="{!contact.account.fax}"/>
<apex:inputField value="{!contact.account.Website_Info__c}"/>
<apex:inputField value="{!contact.account.Nominated_Email_Contact_Website__c}"/>
<apex:inputField value="{!contact.account.Company_Logo__c}"/>
<br><br></br></br>
<apex:commandButton action="{!save}" value="Save" id="theButton" immediate="true"/>
</apex:pageBlockSection>
<apex:pageBlockSection >
<em>
</em>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
Boris Bachovski
Remove the immediate attribute. That skips all the validation rules and setters in the controller.
Charline Mitchener
Thanks Boris, I have removed this but it's still not saving changes.