Arhived documents are displayed when I use a repeater with custom query.

Monjoie Dominique asked on June 1, 2017 12:41

Hello,

I often work with repeaters with custom query.

How can I only get the documents with a 'Published' status (like the option 'Select only published' in a simple repeater).

I noted that all is displayed (even when the documents are Archived').

I red that it's possible to have a where clause 'Published = 1'. I tried this but the system returns me that 'Published' is not a correct field. Sometimes I work with a field like that (visible or not) but in this case, I cannot do it because if I change automatically the value of this field for all my records, I will show records that must stay hidden and if I change this value manually for the records I want to display, I have to change it in more than 150 records.

I also red something about the publishing dates but how to do when you want to prepare your work without knowing when this really will appear on the web.

Thanks.

Correct Answer

Ilesh Mistry answered on June 1, 2017 13:18

There is a field that you could check which is called [DocumentIsArchived], does this help?

0 votesVote for this answer Unmark Correct answer

Recent Answers


Jan Hermann answered on June 1, 2017 13:21

The Published column was removed from the page view. To replace conditions such as Published = 1, use SQL code similar to the following:

[DocumentCanBePublished] = 1
AND
([DocumentPublishFrom] IS NULL OR [DocumentPublishFrom] <= GETDATE())
AND
([DocumentPublishTo] IS NULL OR [DocumentPublishTo] >= GETDATE())
1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.