Updating a multichoice column of an item
Hi,
I have a multi-choice column in a sharepoint list.
The choices being: Choice 1,Choice 2,Choice 3,Choice 4.
I tried creating a visual webpart, where in i'm trying to update the column programmatically, I have used a checkbox list to select multiple options,
Here is the code:
<asp:CheckBoxList ID="chkTechonology" runat="server">
</asp:CheckBoxList>
The code behind to update the item being:
List<string> objList=new List<string>();
foreach (ListItem item in chkTechonology.Items)
if (item.Selected )
objList.Add(item.Value);
listItem["Technology"] = String.Join(", ", objList.ToArray()).Trim(';','#');
It gets saved in the list, but the issue is, whenever i try to edit the item in the list, all the selections are gone.
I need to select the options again and then save the item.
Regards,
Sachin
Hi,
you should set the value as
A;#B;#C
assuming A B C are choices.
Regards
Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer
Similar Messages
-
Received this error (The workflow could not update the item, possibly because one or more columns for the item require a different type of information.) recently on a workflow that was
working fine and no changes were made to the workflow.
I have tried a few suggestions, i.e. adding a pause before any ‘Update’ action (which didn’t help because the workflow past this action without incident); checked the data type being written
to the fields (the correct data types are being written); and we even checked the list schema to ensure the list names and the internal names are aligned (they
are), but we still cannot figure out why the workflow is still throwing this error.
We located the area within the workflow step where it is failing and we inserted a logging action to determine if the workflow would execute the logging action but it did not, but wrote the same error message.
The workflow is a Reusable Approval workflow designed in SharePoint Designer 2010 and attached to a content type.
The form associated with the list was modified in InfoPath 2010.
Approvers would provide their approval in the InfoPath form which is then read by the workflow.
Side note - items created after the workflow throws this Unknown Error some seem to be working fine.
We have deleted the item in question and re-added it with no effect.
Based on what we were able to determine there don’t seem to be any consistency with how this issue is behaving.
Any suggestions on how to further investigate this issue in order to find the root cause would be greatly appreciated?
CheersHi,
I understand that the reusable workflow doesn’t work properly now. Have you tried to remove the Update list item action to see whether the workflow can run without issue?
If the workflow runs perfectly when the Update list item action is removed, then you need to check whether there are errors in the update action. Check whether the values have been changed.
Thanks,
Entan Ming
Entan Ming
TechNet Community Support -
I got error "The workflow could not update the item, possibly because one or more columns for the item require a different type of information "I found out the cause is Update Item action
I need to update item in another List call Customer Report ,the field call "Issues" with data type "Choice" to yes
then the error arise . please help..Thanks for the quick response Nikhil.
Our SPF 2010 server is relatively small to many setups I am sure. The list with the issue only has 4456 items and there are a few associated lists, eg lookups, Tasks, etc see below for count.
Site Lists
Engagements = 4456 (Errors on this list, primary list for activity)
Tasks = 7711 (All workflow tasks from all site lists)
Clients = 4396 (Lookup from Engagements, Tslips, etc)
Workflow History = 584930 (I periodically run a cleanup on this and try to keep it under 400k)
Tslips = 3522 (Engagements list can create items here, but overall not much interaction between lists)
A few other lists that are used by workflows to lookup associations that are fairly static and under 50 items, eg "Parters Admin" used to lookup a partners executive admin to assign a task.
Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties. -
Use Sharepint Approval Workflow to update column in list item
Good afternoon all,
I am working in SP / SPD 2007.
I have set up a standard SP Approval workflow for a new list I am working with.
The workflow assigns tasks to the approvers serially and works fine so far. It sends to the first approver. upon approval it sends to the second approver. Upon approval the workflow marks the workflow column in the "All Items" view as "Approved"
All is well to this point.
My question is this. Can I append an action to this workflow? I have a separate "Status" column. All new items are initially marked "Pending Approval".
I would like that column to be changed to "Approved" upon completion of the approval workflow. I need this separate column for audit purposes as it includes several other important statuses that we track thoughout a request lifecycle. I just want
to automate the updating of this column via the approval workflow.
Any thoughts?
Steve
Steve ConnellyHi Steve,
We can archive this simply in SharePoint 2010, but for SharePoint 2007, we can to create custom approval workflow.
Here are 2 workarounds for you.
Create a custom approval workflow with Visual Studio.
http://msdn.microsoft.com/en-us/library/cc627283(v=office.12).aspx
Use an InfoPath Form instead.
http://msdn.microsoft.com/en-us/library/cc627286(v=office.12).aspx
Thanks & Regards,
Emir Liu
TechNet Subscriber Support in forum
If you have any feedback on our support, please click
here.
Emir Liu
TechNet Community Support -
Tabular Report for Update a single column
Hello Everyone,
I have a tabular report which will display 1 column (apart from primary key),
1. I will display a edit icon (on primary key)
2. when the user selects this icon, this only row must become updatable (only one column must become text item, so that user can modify the value).
3. Next this text item, i would like to display save button and cancel button so that user can click one of these buttons next to that particular row.
Any help would be appreciated.
Regards
AnilThere is no easy way to do this without some incredibly lengthy javascript. Tabular forms still do not give much declarative control to the developer.
If you are looking to click a button and update one column on one row, it's easiest to change your design to two pages using report and form. Make the first page the report with an Edit button, click the button (nothing more than a link) and it goes to a basic form with only one updateable field. After submit, branch back to the first page. Easy.
For the end user, there are no more mouse clicks involved in this than what you described originally so it's likely it'll be an acceptable application design change. -
Hi I have a requirement to create a list item in Contracts List when a document is uploaded in Contracts Vendor library.
Contracts List will
have columns - Contract Name ( title column), Contract Number, Contract Start date and end date.
Contracts Vendor library will have Contract
Name,Contract NUmber.
User will select the Contract Name from drop down ( this is look up column linked to Contract Name in Contract
List).When user uploads document in Contract Vendor library then item should be created in Contract List with selected Contract Name and
Contract number .
Contracts and Contracts Vendor are related by look up Contract Name. Contract Name is internally a title column in
Contracts List.
Issue1 :
Since Contract number is look up column, while I am creating item the Contract name is not getting updated in
Contracts List. I have to use sharepoint designer workflow to achieve this task. Title colum or Contract Name shows no title.
Issue 2:
One
more issue I am facing is that Contracts List has Section and Division cascaded drop downs when i select values from section and division
dropdowns and save item in Contracts list the values are getting saved in Contract List.
Could anyone suggest me how to handle this ? I am
attaching the screenshots of the list and library structure. TRuly appreciate your help.
Below are screenshots of the list structureHi,
According to your post, my understanding is that you wanted to update a title column in list that is a lookup column to document library in sharepoint designer workflow 2010.
I try to reproduce the issues as follows:
Create a custom list named Contracts List, add columns: Contract Name ( title column), Contract Number(Number), Contract Start date(Data and Time) and Contract End date (Data and Time).
Create a document library named Contracts Vendor library, add columns: Contract Name(Lookup), Contract NUmber(Lookup).
Create a workflow associated to the Contracts Vendor library.
Add action: Create List Item.
5. Start the workflow automatically when an item is created.
6. Upload a document, select the Contract Name and Contract NUmber, the workflow will be started automatically.
7. Open the Contracts List, an item will be added with the Contract Name and Contract Number in the Contracts Vendor library.
Thank you for your understanding.
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
How to update managed metadata column for all file in document library using powershell
Hi,
How to update managed metadata column for all file in document library using powershell?
Any help on it.
Thanks & REgards
Poomani SankaranHi TanPart,
I have changed the code which you have give in order to get the files from SharePoint 2010 Foundation Document Library.But i am getting below error in powershell.
Property 'ListItemCollectionPosition' cannot be found on this object; make sure it exists and is settable.
Could you tell me which is the issues in it?
See the code below.
$web = Get-SPWeb http://ntmoss2010:9090/Site
$list = $web.Lists["DocLib"]
$query = New-Object Microsoft.SharePoint.SPQuery
$query.ViewAttributes = "Scope='Recursive'";
$query.RowLimit = 2000
$caml = '<Where><Contains><FieldRef Name="Title" /><Value Type="Text">Process Documents/Delivery</Value></Contains></Where>' +
'<OrderBy Override="TRUE"><FieldRef Name="ID"/></OrderBy>'
$query.Query = $caml
do
$listItems = $list.GetItems($query)
$spQuery.ListItemCollectionPosition = $listItems.ListItemCollectionPosition
foreach($item in $listItems)
#Cast to SPListItem to avoid ambiguous overload error
$spItem = [Microsoft.SharePoint.SPListItem]$item;
Write-Host $spItem.Title
while ($spQuery.ListItemCollectionPosition -ne $null)
Thanks & Regards
Poomani Sankaran -
How to update SharePoint list columns including choice fields programmatically?
Hi All,
I have a requirement to update multiple columns (which are choice columns) in a SharePoint list. I'm a newbie at creating event receivers and timer jobs. Not sure which one to do and where to start first. There are approximately 4500
list items in the lists. I was thinking I could use one list to maintain the Keywords and perform updates or timer job to any targeted lists.
Scenario. Anytime a power user of the sharepoint list wants to update any of the choice field items or possibly even the column name itself, they want to be able to make updates to any of the list
items or other
lists that contain the new name. The columns I'm using are all choice fields named Assigned To, Division, Region, Job Title, Department, and Zone.
Here's sample code for Updating list:
using (SPSite oSPsite = new SPSite("team url/"))
using (SPWeb oSPWeb = oSPsite.OpenWeb())
oSPWeb.AllowUnsafeUpdates = true;
// get the List
SPList list = oSPWeb.Lists["Keywords"];
//Add a new item in the List
SPListItem itemToAdd = list.Items.Add();
itemToAdd["Title"] = "My Title Field";
itemToAdd["Assigned To"] = "Assigned To";
itemToAdd.Update();
// Get the Item ID
listItemId = itemToAdd.ID;
// Update the List item by ID
SPListItem itemToUpdate = list.GetItemById(listItemId);
itemToUpdate["Assigned To"] = "Assigned To Updated";
itemToUpdate.Update();
// Delete List item
SPListItem itemToDelete = list.GetItemById(listItemId);
itemToDelete.Delete();
oSPWeb.AllowUnsafeUpdates = false;
Any help is greatly appreciated. Please provide code sample and references. Thanks!Thanks Ramakrishna -- Here's what I have so far.
namespace MonitorChanges
class MyTimerJob : SPJobDefinition
public MyTimerJob()
: base()
public MyTimerJob(string sJobName, SPService service, SPServer server, SPJobLockType targetType)
: base(sJobName, service, server, targetType)
public MyTimerJob(string sJobName, SPWebApplication webApplication)
: base(sJobName, webApplication, null, SPJobLockType.ContentDatabase)
this.Title = "My Custom Timer Job";
public override void Execute(Guid contentDbId)
// Get the current site collection's content database
SPWebApplication webApplication = this.Parent as SPWebApplication;
SPContentDatabase contentDb = webApplication.ContentDatabases[contentDbId];
// Get a reference to the "ListTimerJob" list in the RootWeb of the first site collection in the content database
SPList Listjob = contentDb.Sites[0].RootWeb.Lists["ListTimerJob"];
// Add a new list Item
SPListItem newList = Listjob.Items.Add();
newList["Title"] = DateTime.Now.ToString();
newList.Update();
Talibah C -
Correct way to handle updates of XMLtype columns in standard tables.
Hello to whoever may read this,
I am currently studying the XML functionality of oracle DB for a uni project.
We have been asked to compare/contrast solutions to publishing product and price data for data stored in standard relational tables, and data stored in XML type tables. For extra marks, i am looking at a table containing an XMLType column for multiple items of data relating to the primarykey.
I have managed to get my head around publishing the data - pretty straight forward, but we have also been asked to show how we can update data, which isn't a problem within the standard tables/columns, but when it comes to the XMLType columns/tables, i dont have a clue.
At the moment i am working on trying to update an XMLtype column. The table itself is a "product" table, and contains product information, as well as an XMLType column containing multiple changes to the prices. In the relational tables, this "product" table has a one-to-many link to another table called price_history which contains details about past prices (which is populated by a trigger on update/insert of a new price). But in this table all the product changes are stored in XML format in the XML type column "prices".
Table columns: id number(4), name varchar2(25), prices xmltype;
example data: 1781, CDW 20/48/E, <product_prices><price_change>
<change_id>1</change_id>
<date_changed>2009-10-13</date_changed>
<details>price increased</details>
<new_value>234</new_value>
</price_change>
<price_change>
<change_id>2</change_id>
<date_changed>2009-10-13</date_changed>
<details>price increased</details>
<new_value>235</new_value>
</price_change></product_prices>
We need to give examples of an update. I have been looking around the net, and these forums for a solution now for about 4 hours. My own thoughts are that to update this with a new price change i need to, SELECT the current data INTO a variable, then concatenate that variable with the new price change info e.g.
<price_change>
<change_id>3</change_id>
<date_changed>2009-10-13</date_changed>
<details>price decreased</details>
<new_value>230</new_value>
</price_change>
then insert that whole chunk of data again to overwrite the old data.
Now im fairly certain there is some function somewhere which will allow me to do this update/insert operation without going through this process... After i am done with this update of XMLType column data, i need to tackle updating data in an XMLType Table with XQuery(? apparently), so if you have any pointers for that please let me know.
Could one of you experts point me in the right direction for this? Any advice at this stage is a great help and will stop me losing my mind.
p.s. im sorry about the lengthy description of the problem/solution required. How to describle something i dont understand? I ask myself.Hi,
You really need to take a look at the XMLDB Developers guide.
For updating XML with SQL/XML see UPDATEXML and for XQuery see [Using XQuery with Oracle XMLDB|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb_xquery.htm#sthref1673]
HTH,
Chris -
SPD workflow not updating a Lookup Column
I have a 2 lists (Computers & Lending Library) that both have a look-up column (Item Status) pointing to a 3rd list (Item Status - Category).
Both lists are properly looking up when manually edited via the web interface. When I try to use a SPD workflow to "Update or Create List Item" and I set the column in the Lending Library (Item Status) = Current Item (Items Status) the column is not populated.
I took the same value and updated a Text column and the value is "0".
The strange thing is when setting the (Item Status) it only gives me the options:
As Integer
Lookup ID (as Integer)
Lookup Value (as Integer)
What am I missing?
Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties.Its been a long time since I looked at this but yes we did figure it out.
Here is my Comment to myself on the lookup: "Must extract the [Item type] as a string and then lookup the corresponding List Item [ID] in the "Item Type - Category" list, use that value to update the "LendLib"[Item
Type]."
As suggested you need to reference the ID of the lookup, and I am caching that. Then when setting the [Item Type] column, by referencing the [ID] column in the Lookup list, then set your value to the Title of that lookup.
If I recall the issue was the lookup, if you don't use the [ID] then you don't actually retrieve the value from the [Title] column correctly.
My screenshots below are a bit confusing at first because my Lookup List is called "Item Type - Category" and the column in the 2nd list that is the
Lookup Column, is called "Item Type".
Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties. -
How to get column values on item added event receiver
Hi,
I have two columns in a document library and one is people or group column and the other one is choice column with check boxes.
I want to know how to read column values on Item Added event receiver, so that I can create if statements based on those values.
Thank you,
AA.Hi AOK2013,
Have you had a look at this Microsoft tutorial: http://msdn.microsoft.com/en-us/library/office/gg981880(v=office.14).aspx
Essentially, you want to use the AfterProperties property to access the changed field value.
E.g.
var personvalue = properties.AfterProperties["YourPersonFieldName"]
Regards, Matthew
MCPD | MCITP
My Blog
View
Matthew Yarlett's profile
See my webpart on the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here:
Upload and Crop User Profile Photos -
I have tried to update my ipad 2 several times. I have connected it to my computer in itunes had it download or backup my info. But when I go to update it states you have purchased items not backed up are you sure you want to update now? So I go back and check it for all my apps and they are all there on the computer in itunes. I still have the original iso 4.3.3 please help as all
Even though you think that all of your apps and purchased content is in iTunes, transfer your purchases using these instructions and then try and update again.
iTunes Store: Transferring purchases from your iOS device ... -
I have tried to update my ipad 2 several times. I have connected it to my computer in itunes had it download or backup my info. But when I go to update it states you have purchased items not backed up are you sure you want to update now? So I go back and check it for all my apps and they are all there on the computer in itunes. I still have the original iso 4.3.3 please help as all the apps are requiring newer iso versions.
Hi Oceanbreeze,
If you are receiving an alert about purchased items that have not been transferred from your iPad, you may want to try initiating the transfer from iTunes to see if that may correct it. You may find the following article helpful:
iTunes Store: Transferring purchases from your iOS device or iPod to a computer
http://support.apple.com/kb/ht1848
Regards,
- Brenden -
Access for update only one column in table?
Hi all,
My need is to grant access for update only one column c1 in table t1.
I guess I should use view, could you please give me some example? Maybe other ideas?Hi,
You can grant privileges on individual columns.
GRANT UPDATE (c1)
ON t1
TO grantee_name;Look up GRANT in the SQL language manual. Annoyingly, in recent editions of the manual, GRANT is not indexed, but it's in alphabetic order with all the other statements:
http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_9013.htm#i2155015 -
Update a single column of a table
Hi Champs,
I want to update a single column of table PA0000.
Following is ABAp code I am using:
UPDATE pa0000 SET massn = wa_upd_actn71-massn
WHERE pernr = wa_upd_actn71-pernr AND
massn = c_crct_entry.
where in current scenario wa_upd_actn71-massn = 54,
wa_upd_actn71-pernr = 10005092,
c_crct_entry = 71.
But this code is not working and note updating the DB table PA0000.
Can you help me out?
Edited by: Nishant Khimesra on Apr 7, 2009 2:00 PM
Edited by: Nishant Khimesra on Apr 7, 2009 2:00 PMhiii,
If u want to update it thr program then write the query as update <dbtablename> set fld = value where <condn>. make sure that the values u pass are converted as per the values in database.
2nd way is goto se16n
specify table name and then enter &sap_edit on command line. sap editing function will be edited. specify the filter parameters on the field and then execute the transaction. u can change thd data instantly as the data appears in editable alv.
Regards,
Anil N.
Maybe you are looking for
-
Itunes has encountered an error report and needs to close. help!
Hello B Noir. Having the same trouble with this error message. Have removed lots of software off PC, deleted user accounts and set up a new one, downloaded iTunes 9 and then the lastest Quicktime. Am now running the spyware link you provided. Detail
-
Managing Lync Online user traffic
Hi, Trying to understand what is the best way to route the Lync online user traffic from corporate LAN to Lync online server and to users connected on Internet. I see that suggested methods are route it via firewall or proxy Challenges I see with fir
-
I downloaded firefox from IE. I had many bookmarks that I accessed from my Yahoo e-mail toolbar page. They are all missing and I need them, I want to go back to IE and delete firefox but there is no instructions on how to do this.
-
Hi We have an issue, our client is having Internal order and it is settled to CO-PA. But now they want to change the profit center in the IO master data, where as postings are already done with different profit center. One of the characteristics in C
-
Can you use regular ringtones as alert tones or is it just for calls
???