Invalid data is used to update the list item invalid data has been used to update the list item. The field you are trying to UPD

Source: Internet
Author: User

In SharePoint development, when we add, delete, and modify list items, we only pay attention to common columns, such as "single line of text ", "multiple lines of text", "Choice (menu to choose from)", and so on, and these columns values are well processed.CodeIs the string, Int, datetime type, as long as the corresponding OK.

However, we may accidentally or mistakenly assign an incorrect value to a column of the type. The column type is "person or group ".

Most of the time, we can see that the value of the person or group type in the operation is displayname or loginname, And the intuitive judgment is the value of the string type. However, be careful when assigning values to columns of the "person or group" type:The data type of "person or group" is "spuser"

As follows:

In this case, assign a value to the column of the "person or group" type to the column of the stirng type. Immediately modify the code, as shown in:

 

Perfect, code execution passed, no problem.

Summary:

When we assign a value to a column of the "person or group" type, we must assign the "spuser" to it.Use the SharePoint built-in method to directly obtain the spuser object, AlsoYou can use the spweb. ensureuser () method to convert "domain \ Username" to a spuser object.And then assign values.

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.