Can removeDate be optional?

5 posts by 2 authors in: Forums > CMS Builder
Last Post: November 30, 2010   (RSS)

By zip222 - November 29, 2010 - edited: November 30, 2010

I would like to use the removeDate field, but it seems that it's required. If I leave the field blank when adding a record, the record doesn't show up on the site. This means the user needs to specify a removeDate for every item, which isn't practical. Am I overlooking something?

Re: [Jason] Can removeDate be optional?

By zip222 - November 30, 2010

Great. And how would I combine that with another where statement that I need to include...

'where' => 'archive=0',
'where' => "removeDate >= NOW() OR removeDate='0000-00-00 00:00:00'",

Re: [zip222] Can removeDate be optional?

By Jason - November 30, 2010

Hi,

Try this:

'where' => "(removeDate >= NOW() OR removeDate='0000-00-00 00:00:00') AND archive=0",

In this example, it will only return records where the archive checkbox hasn't been checked.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Can removeDate be optional?

By zip222 - November 30, 2010

Thanks again. And in case anyone else tries to utilize this, note that you also need to add the "'ignoreRemoveDate' => true," to your detail pages.