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
buebloodbueblood 

Update selected values into standard object

How do we update the values selected from a checkbox in a visualforce page onto a standard object?

I want to display a list of active users in salesforce and on checkbox click deactivate the corresponding user accounts.

Scott_VSScott_VS

You will want to create a wrapper class in your VF controller to bind a boolean variable to each User object. then output the boolean (as a checkbox) and user object together on your page. When you click an action button on the page, go through the list of wrappers and if the boolean is true (ie, the checkbox is selected), add them to a list of usersToUpdate with isActive = false, then run an update on that userToUpdate list after your loop.

 

Here's a blog post to help you with the wrapper:

 

http://wiki.developerforce.com/page/Wrapper_Class