Share via


how to change list item status to "completed" in sharepoint 2010?

Question

Thursday, September 27, 2012 10:19 AM

i have too many items which are in progress, inactive, pending or can be anything except "complete". I want to select some list items and change the status to "Complete". I know by adding a button in the ribbon. but i do not know the coding. please provide me if anyone knows how to do it.

Ramanjulu Naidu N

All replies (12)

Thursday, September 27, 2012 10:42 AM

Hi,

Do you mean editing a list item (Is this a task list?)

 

ceren


Thursday, September 27, 2012 11:09 AM

List have column name "Status" which is drop down(choice). it is not a task list. Even if it is task we can only approve or reject. my requirement is to change it to "complete" for all the selected list items. this has to be done by just clicking check box or button.

Ramanjulu Naidu N


Thursday, September 27, 2012 11:11 AM

What kind of list are we talking about? Is this "Status" column a custom column that you have created or are you using a workflow or the content approval feature of SharePoint.

Please "Mark as Answer" if a post has answered your question or "Vote as Helpful" if it was helpful in some way. Here's why


Thursday, September 27, 2012 11:15 AM

this is a custom list(ootb). I have created a column called "Status" which pending, inactive, in progress and completed in the drop down.

Ramanjulu Naidu N


Thursday, September 27, 2012 11:16 AM

Hi,

You can do this through ribbon or out of box. either you have to update status field by editing each and every item or you can update all list items column value in single shot. There is no feature available to update column value of selected items.

You can also open your list in datasheet view and update value like we do in excel.

Here is powershell command which will update status for all items:

#Get all items in this list and save them to a variable
$items = $list.items
#Go through all items
Foreach($item in $items)
{
   #If the "Title" column value equals "My first item!" do something with it
    if($item["Title"] -eq "My first item!")
    {
    #Change the value of the "status" column
    $item["Statsu"] = "Completed"
    #Update the item
    $item.Update()
    }
}

Hope it could help

Hope it could help 

Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"


Thursday, September 27, 2012 11:19 AM

I think we can do it by adding a button in the ribbon using javascript. and i do not want to change all list items status at one shot. only selected list items.

Ramanjulu Naidu N


Thursday, September 27, 2012 11:21 AM

If I got this right,

Add a new choice to your Status Column - 'complete'

Switch to Dataview and bulk change ?

ceren


Thursday, September 27, 2012 11:22 AM

i think this article suits my requirement but it is not working for me. though it is for approving.

http://sharepointjavascript.wordpress.com/2012/01/12/approve-multiple-documents-or-list-items-in-one-operation-with-client-side-code/

Ramanjulu Naidu N


Thursday, September 27, 2012 11:27 AM

in datasheet view i have tried to change complete. could not able to do it. can you explain me how to do it.

Ramanjulu Naidu N


Thursday, September 27, 2012 11:29 AM | 1 vote

Hi,

I want to avoid the code that's why i said no out of box. If you are ok with ECMA script then you can get all selected item using ctx and update same. I don't have exact code but this thread may help you:

 var items = SP.ListOperation.Selection.getSelectedItems(ctx);

http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/cf7347b7-2ff4-4977-9251-b17ec9939af3/

http://www.learningsharepoint.com/forum/sharepoint-2010-programming/get-selected-items-in-a-list-sharepoint-2010/

Hope it could help

Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"


Thursday, September 27, 2012 11:29 AM

You need to edit the Status column through the list settings. Go to list settings, click on the column name (status). Add 'complete' as a choice. then return to datasheet and you'll be able to pick that.

ceren


Thursday, September 27, 2012 11:32 AM

bulk can't be done. i have tried.

Ramanjulu Naidu N