SharePoint Date UTC 말고 출력시

2014.03.17 17:37 개발언어/SharePoint
SharePoint Date UTC 말고 출력시

The different Query Options need to be handled a bit differently than with the SharePoint Server Object Model.

The row limit can also be specified within the ViewXml property:

query.ViewXml = "<View>"
   + "<Query>"
   + "<Where><Eq><FieldRef Name='Country' /><Value Type='Text'>Belgium</Value></Eq></Where>"
   + "<OrderBy><FieldRef Name='City'/></OrderBy>"
   + "</Query>"
   + "<RowLimit>5</RowLimit>"
   + "</View>";

Dates in UTC

You can choose to return dates in UTC (Coordinated Universal Time)  by setting the DatesInUtc property of the CamlQuery instance:

query.DatesInUtc = true;

query.DatesInUtc = false;  //꺼준다.

Include attachment URLs

Using CAML you are able to know if list items have attachment by adding a w> element to the ViewFields element in the ViewXml property:

query.ViewXml = "<View>"  
   + "<ViewFields>"
   + "  <FieldRef Name='Title' /><FieldRef Name='City' /><FieldRef Name='Attachments' />"
   + "</ViewFields>"
   + "</View>";

 SharePoint will return a boolean indicating whether the list item has attachments or not.