Below is the SharePoint web service I am using to get list items from a SharePoint 2007 calendar list. The calendar list has a people picker field which can have more than one user. Now as I run the query there is multiple row in my query result for the items having more than one user in people picker field. For each user it is creating a separate row with same id, title etc but with different value in people picker field.

Can anyone help me how to modify my query to get the exact rows and not the duplicate ones.

System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
            System.Xml.XmlElement query = xmlDoc.CreateElement("Query");
            System.Xml.XmlElement viewFields =
            System.Xml.XmlElement queryOptions =
            query.InnerXml = "<Where><Gt><FieldRef Name=\"ID\" />" + "<Value Type=\"Counter\">0</Value></Gt></Where>";
            viewFields.InnerXml = "<FieldRef Name=\"Title\" />" + "<FieldRef Name =\"fRecurrence\" />" + "<FieldRef Name =\"RecurrenceID\" />" + "<FieldRef Name =\"RecurrenceData\" />";
            queryOptions.InnerXml = "";
            XmlNode listItems = client.GetListItems(ListTitle, "", query, viewFields, "0", queryOptions, null);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.