sharepoint: editing webpart caml

Posted by Jack on Stack Overflow See other posts from Stack Overflow or by Jack
Published on 2010-06-17T21:38:46Z Indexed on 2010/06/17 21:43 UTC
Read the original article Hit count: 287

Filed under:
|
|

I added this code to my sharepoint content query web part, which is looking at an events list from my calender, .webpart file in order to only show recurring events within the next month and regular events within the next month. However, I can't get the web part imported and working. Also is there any way to replace <Month /> with a range like <Today:Today OffsetDays="30"/> except with valid code?

Here is the code:

<property name="QueryOverride" type="string">
<Where> 
<Or> 
<And> 
  <Neq> 
    <FieldRef Name="FRecurrence"/> 
    <Value Type="Recurrance">1</Value> 
  </Neq> 
  <And>  
    <Lt> 
      <FieldRef Name="EventDate" Type="DateTime"/> 
      <Value Type="DateTime"><Today OffsetDays="30"/></Value> 
    </Lt> 
    <Gt> 
     <FieldRef Name="EventDate" Type="DateTime"/> 
    <Value Type="DateTime"><Today /></Value> 
    </Gt> 
  </And> 
</And> 
<DataRangesOverlap> 
  <FieldRef Name="EventDate" /> 
  <FieldRef Name="EndDate" /> 
  <FieldRef Name="RecirrenceId" /> 
  <Value Type="DateTime"><Month /></Value> 
</DataRangesOverlap> 
</Or>    
</Where>
</property> 

When I upload this I get "Unable to add selected web part(s). The file format is not valid" and when I add <![CDATA[ and ]]> I can import it but the query doesn't return anything. How can I get this to work?

© Stack Overflow or respective owner

Related posts about sharepoint

Related posts about caml