+ Start a Discussion
SirishaMSirishaM 

Autonumber field

Hi ,

I have a object which has autonumber field whose format is S-{00000}
Can I give input to this field through a inputText field in Visualforce page ?

Even though I am giving the value in same format value through inputText ..it is giving error saying Invalid field value when I am trying to insert this value into object.


Thanks,
Sirisha


TehNrdTehNrd
Seems counter intuitive. If you have an auto number field why are you trying to set the value?
SirishaMSirishaM
Probably I was not clear in previous message ..This is what I meant to say..

I created a page which has one field to enter a value for lookup field . I dont want lookup window to appear as it shows all
records. So I used inputText in  Visualforce page. So when I am assigning this value to the field in the object.It was giving error saying Invalid Id.


TehNrdTehNrd
Input text fields can only be set to Strings in the controller. If you are entering the name of the record you need to assign it to a string variable in the controller and then run a SOQL query on the object to retrieve the record where name = :nameVariable.


Message Edited by TehNrd on 05-09-2008 01:35 PM
SirishaMSirishaM
Thanks a lot !!! That worked..