I need to search for certain Pages with a PageReference-Property set to a published page on a multisite-, multilanguage-environment with CMS5 R2 Sp2, but when I use FindPagesWithCriteria I only get pages which are published. So I tried with FindAllPagesWithCriteria but with the same results, I also added the criteria PagePendingPublish (since that worked in 4.62) but still can't retrieve unpublished pages. Any ideas on how I can search for pages which are not published?
There is no way of searching in properties that have not been published (since those are stored in separate versioning tables in the database until you hit Publish).
Oh, but is there a way to work around this by searching directly in the database?
You could access tblWorkProperty directly, but just remember that it is unsupported and not recommended since it may stop working in a future upgrade if we make changes to the schema. Your first option should be to find another way of solving the problem in hand.
Yes, I solved it with setting startpublish and stoppublish to DateTime.Now and then it was possible to find them. Thank you for your answer!