You need to sign in to do that
Don't have an account?
Update Just One Record in List
Hello. I am running into problems trying to update a single member of a list...and wondered if anyone could point me in the right direction.
I am displaying an editable list of results from a search query called "recordsList". I have inserted a CommandButton command in the VF page so a "save this record change" button is displayed next to each member of this list (I know I could simply place a button at the bottom of the overall list to resave the entire list - but I instead want to provide the ability to save individual records).
The below controller code works fine when just one search result is displayed - but it does not save the desired record when "recordsList" displays multiple records.
Below is the controller code I am using. I had hoped that the "[0]" piece of code would allow me to address individual members of the list - but I am obviously wrong.
Any suggestions would be greatly appreciated. Thanks.
CONTROLLER CODE
Public PageReference SaveThisRecord() {
{
update recordsList[0};
}
return null;
}
update recordsList[0};
Is it a typo?
update recordsList[0];
Sorry. That was a typo. I have re-posted my inquiry to be a bit more specific.