Source Script Component to read data from Sharepoint List - read multi choice field values

All examples I found refer to classes under Microsoft.SharePoint namespace. However, I have the SharePoint CSOM that only gives me the Microsoft.Sharepoint.Client namespace.

I need to read the selected values of a multichoice field, but not sure how to do it with classes in the namespace above.

everthing works, exept the TSQL_x0020_Reference_x0020_Numbe field.

my code looks like this:

****

Webweb = cont.Web;

            cont.Load(web);

            cont.ExecuteQuery();

           

Listsstest = web.Lists.GetByTitle("T-SQL Code Review Tracking");

           

//CamlQuery query = CamlQuery.CreateAllItemsQuery();


           

CamlQueryquery = newCamlQuery();

            query.ViewXml =

                   

@"<View>

                           <ViewFields>

                                <FieldRef Name='Category'/>

                                <FieldRef Name='Review_x0020_Type'/>

                                <FieldRef Name='Review_x0020_Start_x0020_Date'/>

                                <FieldRef Name='Title'/>

                                <FieldRef Name='Location'/>

                                <FieldRef Name='Project'/>

                                <FieldRef Name='Author0'/>

                                <FieldRef Name='AssignedTo'/>

                                <FieldRef Name='TSQL_x0020_Reference_x0020_Numbe'/>

                            </ViewFields>

                         </View>"

 ListItemCollectionitems = sstest.GetItems(query);

            cont.Load(items);

            cont.ExecuteQuery();

           

foreach(ListItemitem initems)

            {

                Output0Buffer.AddRow();

                Output0Buffer.ReviewStatus = item.FieldValues[

"Category"] != null? item.FieldValues["Category"].ToString() : String.Empty;

                Output0Buffer.ReviewType = item.FieldValues[

"Review_x0020_Type"] != null? item.FieldValues["Review_x0020_Type"].ToString() : String.Empty;

                Output0Buffer.ReviewDate =

DateTime.Parse(item.FieldValues["Review_x0020_Start_x0020_Date"].ToString());

                Output0Buffer.Module = item.FieldValues[

"Title"] != null? item.FieldValues["Title"].ToString() : String.Empty;

                Output0Buffer.BranchLocationURL = item.FieldValues[

"Location"] != null? item.FieldValues["Location"].ToString() : String.Empty;

                Output0Buffer.ProjectName = item.FieldValues[

"Project"] != null? item.FieldValues["Project"].ToString() : String.Empty;

                Output0Buffer.Author = item.FieldValues[

"Author0"] != null? item.FieldValues["Author0"].ToString() : String.Empty;

 


               

FieldLookupValueflvAssignedTo = newFieldUserValue();

                flvAssignedTo = item.FieldValues[

"AssignedTo"] asFieldLookupValue;

               

if(flvAssignedTo != null)

                {

                    Output0Buffer.AssignedTo = flvAssignedTo.LookupValue;

                }

               

varv = item.FieldValues["TSQL_x0020_Reference_x0020_Numbe"];

               

if(v != null)

                {

                    Output0Buffer.Reason2 = v.ToString();

                }

             }

             Output0Buffer.SetEndOfRowset();           

April 28th, 2015 9:20pm

Hi Maecelo,

I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.

Thank you for your understanding and support.

Regards,
Katherine Xiong

Free Windows Admin Tool Kit Click here and download it now
April 30th, 2015 2:38am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics