2

I have a Visualforce page which displays pageBlockSection of Contact with mode="inlineEdit"

 <apex:pageBlock title="{!contact.name}" mode="inlineEdit">
<apex:pageBlockSection title="Contact Information" >
  <apex:outputField value="{!contact.Name}" />
  <apex:outputField value="{!contact.Primary_Languages_Spoken_VRM__c}" />
  <apex:outputField value="{!contact.Choices_Offered__c}" />
  <apex:outputField value="{!contact.Owner}" />
</apex:pageBlockSection >
<apex:pageBlock>

But I am not able to edit Name & Owner. I have checked Field Level accessibility - it is all editable for my profile. But why I am not able to edit in the VisualForce Page?

1

You should be using apex:inputField rather than apex:outputField. As SFDC documentation states, outputField is...

A read-only display of a label and value for a field on a Salesforce object.


What your VF page should look like is something like this:

<apex:pageBlock mode="inlineEdit">
  <apex:pageBlockSection title="Contact Information">
    <apex:inputField value="{!contact.Name}" />
    <apex:inputField value="{!contact.Primary_Languages_Spoken_VRM__c}" />
    <apex:inputField value="{!contact.Choices_Offered__c}" />
    <apex:inputField value="{!contact.Owner}" />
  <apex:pageBlockSection title="Contact Information">
</apex:pageBlock>

Edit #1

Apparently, it is not possible to inline edit owner:
https://success.salesforce.com/ideaView?id=08730000000Bp6WAAS

However, you should be quite able to edit the Name of the Contact.

  • But mode="inlineEdit" should make it editable. I am able to edit Primary_Languages_Spoken_VRM__c & Choices_Offered__c. – Nancy Jan 16 '14 at 15:57
  • Actually, I'm quite unclear how did you manage to edit anything, since you specified inlineEdit mode attribute on the pageBlockSection, when according to the doc it should be specified on pageBlock: salesforce.com/us/developer/docs/pages/Content/… – dino ursic Jan 16 '14 at 16:02
  • Sorry my mistake. it is in pageBlock. Edited my question. – Nancy Jan 16 '14 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.