You need to sign in to do that
Don't have an account?

Field on Visualforce page is read-only when it should not be
I am working on a visualforce page so that users can create certain opportunities (it's similar to a wizard, but it is only 1 page). For some users, the Account Name field is read-only. The administrators say that those people have the correct permissions, so is there anything that I can check or implement in order for the field to appear as an inputfield for them? Thanks.
The profile for the users that had the problem cannot created Account records, only read and edit them. The users were able to see the field on regular opportunity pages, so it had to do with the tag I used on my Visualforce page.
I had this tag:
<apex:inputField value="{!account.Name}" required="true"/>
with this getter and setter on the extension:
public Account getAccount() {
if( acc == null ) {
acc = new Account();
}
return acc;
}
public void setAccount( Account acc ) {
this.acc = acc;
}
So, as it was explained to me, if the account is null, which it will be the first time, then a new account is created. An account is not really submitted, but it is created.
To fix this, I replaced the tag with this:
<apex:inputfield value="{!Opportunity.AccountID}"/>
Not only were the users now able to see the field, but the Account lookup button was now next to the field as well.
All Answers
The profile for the users that had the problem cannot created Account records, only read and edit them. The users were able to see the field on regular opportunity pages, so it had to do with the tag I used on my Visualforce page.
I had this tag:
<apex:inputField value="{!account.Name}" required="true"/>
with this getter and setter on the extension:
public Account getAccount() {
if( acc == null ) {
acc = new Account();
}
return acc;
}
public void setAccount( Account acc ) {
this.acc = acc;
}
So, as it was explained to me, if the account is null, which it will be the first time, then a new account is created. An account is not really submitted, but it is created.
To fix this, I replaced the tag with this:
<apex:inputfield value="{!Opportunity.AccountID}"/>
Not only were the users now able to see the field, but the Account lookup button was now next to the field as well.