You need to sign in to do that
Don't have an account?
sparky
showing custom object name field as required
There have been a few posts about making fields show as required (little red bar):
* http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=2419
* http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=1254
in which SF folks say that in order to make the bar appear, just use an inputField element, and make the field required in your field definitions.
Fair enough, that seems to work most of the time.
However, in my current project I've got a custom object, and the Name field is included on a VF page. And I'm using an inputField element, but it's not showing the red bar. And moreover, if I leave the field blank, it gets filled in somehow with the ID of the record, rather than throwing an error.
I thought Name fields were required by definition. If I edit the record in the standard layout, I get the red bar and leaving the Name blank throws an error.
I'm using the standard controller (with an extension). Is this a bug?
Thanks much!
* http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=2419
* http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=1254
in which SF folks say that in order to make the bar appear, just use an inputField element, and make the field required in your field definitions.
Fair enough, that seems to work most of the time.
However, in my current project I've got a custom object, and the Name field is included on a VF page. And I'm using an inputField element, but it's not showing the red bar. And moreover, if I leave the field blank, it gets filled in somehow with the ID of the record, rather than throwing an error.
I thought Name fields were required by definition. If I edit the record in the standard layout, I get the red bar and leaving the Name blank throws an error.
I'm using the standard controller (with an extension). Is this a bug?
Thanks much!
The name field will be stored with the id field.
Not only name field if there is any req fields, if you didn't provide any value to them then salesforce will automatically stores the record id.
So it is better to use either inputfield or you have to write your own error handling, if that field is null throw an error message before save.
Thanks
Srini
Hi Guys,
In 2012, I am also facing the same error. Am I missing something here?