function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
dsh210@lehigh.edudsh210@lehigh.edu 

update on fields failing

I have a custom visualforce page that displays some fields that the user can edit the values of. When the user clicks my save button, it updates the values (just by running the command "update" on the object) and returns to a list of all the elements. The update was working fine, but then as I was editing, it simply stopped working. I undid all of the changes I had made since it was last working and no dice... 

 

Does anyone know what may block this update from taking place? I make my changes, save them, then they just retain their old values.

 

Thanks for any suggestions.

Best Answer chosen by Admin (Salesforce Developers) 
jwetzlerjwetzler

It probably is on your page.  Are you in dev mode?  Make sure you're looking at the source for the frame and not for the outer, dev mode container page.  You can add ids to your inputs which should help decipher those ids, but yes the 0 and 3 refer to the rows in your table.

 

Here's some more info about that error message:

http://community.salesforce.com/t5/Visualforce-Development/Validation-Error-Value-is-not-valid-One-Cause-Solution/m-p/180458

All Answers

jwetzlerjwetzler

your page is just refreshing?  have you added any required fields to User or made some validation rule changes?

 

put the pagesMessages component somewhere on your page to see if there are any validation errors.

dsh210@lehigh.edudsh210@lehigh.edu

Thank you that was a huge help. It is reporting error:

 

j_id0:AttributeDefForm:j_id33:mainTable:0:j_id56: Validation Error: Value is not valid

j_id0:AttributeDefForm:j_id33:mainTable:3:j_id56: Validation Error: Value is not valid                                  

 

I popped open the page source to try and find the root of the problem, but j_id56 was nowhere to be found. How is it possible that the element exists, but is not in the page source? I am assuming that the mainTable:0 refers to the first column in the table, and mainTable:3 refers to the fourth. Is this correct?

 

Thank you.

jwetzlerjwetzler

It probably is on your page.  Are you in dev mode?  Make sure you're looking at the source for the frame and not for the outer, dev mode container page.  You can add ids to your inputs which should help decipher those ids, but yes the 0 and 3 refer to the rows in your table.

 

Here's some more info about that error message:

http://community.salesforce.com/t5/Visualforce-Development/Validation-Error-Value-is-not-valid-One-Cause-Solution/m-p/180458

This was selected as the best answer
dsh210@lehigh.edudsh210@lehigh.edu

Thank you, that link was great. I understand the issue, so now I am trying to work out a solution. The problem arises when the user enters more than one option for the picklist. The way I have it set up is that a textarea is created with a line separated list of current picklist values. The user can make changes, then click save changes and it updates the object. However, some confusion must arise with the validation, because when there is more than one option entered, for example:

 

Value 1

Value 2

 

I get that there was the validation error.

 

Just having:

 

Value 1

 

works to save changes and continue using the page. I will see if I can figure out how the newline is confusing the validation.