Hi Lee,

 

Thanks for the reply.

 

What you say is true... but if I specify the date filter in the
QueryOverride property it then seems to ignore the ContentTypeBeginsWithId
property? L

 

I have one document in my site collection that uses the base content type
but if I specify the date range in the QueryOverride it returns everything.
If I take it out I get the one document again.

 

I have tried using the begins with and contains Query operators to no avail.
I have reverted to using a series of Or statements in my query. As below.

 

  <Where>

    <And>

      <Or>

        <Eq>

          <FieldRef Name="ContentType" />

          <Value Type="Text">Document 1</Value>

        </Eq>

        <Or>

          <Eq>

            <FieldRef Name="ContentType" />

            <Value Type="Text">Document 2</Value>

          </Eq>

          <Eq>

            <FieldRef Name="ContentType" />

            <Value Type="Text"> Document 3</Value>

          </Eq>

        </Or>

      </Or>

      <Geq>

        <FieldRef Name="Modified" />

        <Value Type="DateTime">

          <Today OffsetDays="-7"/>

        </Value>

      </Geq>

    </And>

  </Where>

 

The problem with this is that, obviously, it is not dynamic and every time a
new content type is added then the query needs to change.

 

If anyone has a better solution I would love to hear it.

 

Thanks

Pete

 

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Lee Marriage
Sent: Tuesday, 4 December 2007 12:36 PM
To: [email protected]
Subject: RE: [OzMOSS] CAML Query for updated content

 

Hi Pete,

 

The CQWP actually provides a property for doing such a query. Look for the
'ContentTypeBeginsWithId' property. Then all you have to worry about in your
CAML query is items that have been modified in the last 7 days J

 

Cheers,

 

Lee Marriage 
Senior Consultant
Information Management 

Direct:    02 8001 7786
Fax:       02 8001 7778
Mobile:   0406 051 527
Email:    [EMAIL PROTECTED]
Web:      <http://www.uniqueworld.net> www.uniqueworld.net
 <http://www.uniqueworld.net/> 
innovative business solutions that make a difference 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Peter Vranich
Sent: Tuesday, 4 December 2007 12:30 PM
To: [email protected]
Subject: [OzMOSS] CAML Query for updated content

 

Hi All,

 

I was wondering if anyone knew how to, if it is possible to, query
everything that has a base content type of "My Custom Content Type" using
the CQWP?  I am trying to write the CAML query but don't want it to return
the xsl file(s) or form(s) or system images... etc, etc.  I just want
updated pages and documents.

 

So I thought I'd just be able to create a "base" content type and derive all
my content pages/page layouts/documents etc from these base content types
and query that but how do you write the CAML to query everything that has
that "base" content type?  The UI for the CQWP has this option but how do
you replicate this in the QueryOverride property?

 

I.e Get everything that has been Modified in the last seven days that has a
base content type of "My Custom Content Type".

 

Cheers

Pete

 

-------------------------------------------------------------------
OzMOSS.com - to unsubscribe from this list, send a message back to the list
with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net 

-------------------------------------------------------------------
OzMOSS.com - to unsubscribe from this list, send a message back to the list
with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net 




------------------------------------------------------------------- OzMOSS.com 
- to unsubscribe from this list, send a message back to the list with 
'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net

<<image001.gif>>

Reply via email to