Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • suzyb 474 posts 932 karma points
    May 27, 2013 @ 16:09
    suzyb
    0

    Best way to find document with certain property value

    I'm using CMS import to import a CSV file.  When importing I want to find documents that have a field that matches the imported document and publish or unpublish this document depending on the value of another field imported.  I am unsure how to select the document however.

    I was using the following but I have since organised the documents so they are no longer direct children of document 1282 and it no longer seems to work.

    uQuery.GetDocument(1282).GetChildDocuments().Where(x => x.getProperty("courseCode").Value.ToString() == courseCode).FirstOrDefault();

    Neither does

    uQuery.GetDocument(1282).GetDescendantDocumentsByType("Course").Where(x => x.getProperty("courseCode").Value.ToString() == courseCode).FirstOrDefault();

    Using this method also seems to cause the import to be very slow.

    How can I find a descendant with a property that matches a certain value.

Please Sign in or register to post replies

Write your reply to:

Draft