Forcing a custom field to be a mandatory date

What would be the proper string to make a Custom field Mandatory and contain
a date field?

Vance Walsh
Network and Systems Administrator
Concord Academy - Concord, Mass.

Vance,

Well, there are a few vastly different ways to do this:

  1. If on rt 3.6.x, you can use any of these formatting sequences:

for format control of “mm/dd/yyyy”

(?#Date
mm/dd/yyyy)^(((0)?[1-9]|1[0-2])/((0)?[1-9]|[12][0-9]|3[01])/([12][0-9])?[0-9][0-9])?$

for format control of “yyyy/mm/dd hh:mi:ss”

(?#Date yyyy/mm/dd
hh:mi:ss)^(([1-2][0-9][0-9][0-9])/(0[1-9]|1[0-2])/(0[1-9]|[1-2][0-9]|3[0-1])
(0[1-9]|1[0-2]):(0[1-9]|1[0-2]):(0[1-9]|1[0-2]))?$

for format control of “yyyy/mm/dd”

(?#Date
yyyy/mm/dd)^(([1-2][0-9][0-9][0-9])/(0[1-9]|1[0-2])/(0[1-9]|[1-2][0-9]|3[0-1]))?$

  1. If on 3.8.8+, you can make the CF a “SelectDate” field and get the use of
    Calendar. However, there is no “built-in” way to make the field mandatory
    unless you add some of your own code. This has been discussed in past
    threads. We choose to keep the basic code and work around the problem by
    writing a scrip to use another CF and re-set the Status field (to "stalled"
    when they “resolve” without setting the date field) and then send email
    notifications to alert the ticket owners that they need to put in the date
    field). This is a bit simple, but keeps us from messing with code. However,
    there are some other options discussed that modify the RT code and allow the
    CF to be treated as a “TRULY” mandatory field. Check out the threads. I
    believe there is even a link to some of that code.

Hope this helps.

Kenn
LBNLOn Mon, Apr 11, 2011 at 6:30 AM, Vance Walsh <vance_walsh@concordacademy.org wrote:

What would be the proper string to make a Custom field Mandatory and
contain a date field?


Vance Walsh
Network and Systems Administrator
Concord Academy - Concord, Mass.

  1. If on 3.8.8+, you can make the CF a “SelectDate” field and get the use of Calendar.

The SelectDate field that you are referencing is a third party patch
with known problems and we cannot advise that you use it.

We have reimplemented this feature properly for RT4

-kevin

Kevin,

I thought I had read somewhere that 3.8.8 had a Custom Field type option for
Dates. I was hoping this was true so I could throw away the Custom Code I am
using that was contributed by Emmanuel Lacour. Right now, the code works
pretty well, other than I have no options to format the data to be
consistent with my date formatting preferences for other date fields.

If this is NOT the case, are there any plans to put the RT 4 code into
3.8.10?

Thanks.

Kenn
LBNLOn Mon, Apr 11, 2011 at 1:46 PM, Kevin Falcone falcone@bestpractical.comwrote:

On Mon, Apr 11, 2011 at 11:12:13AM -0700, Kenneth Crocker wrote:

  1. If on 3.8.8+, you can make the CF a “SelectDate” field and get the
    use of Calendar.

The SelectDate field that you are referencing is a third party patch
with known problems and we cannot advise that you use it.

We have reimplemented this feature properly for RT4

-kevin

However, there is no “built-in” way to make the field mandatory unless
you add some of your
own code. This has been discussed in past threads. We choose to keep
the basic code and work
around the problem by writing a scrip to use another CF and re-set the
Status field (to
"stalled" when they “resolve” without setting the date field) and then
send email
notifications to alert the ticket owners that they need to put in the
date field). This is a
bit simple, but keeps us from messing with code. However, there are
some other options
discussed that modify the RT code and allow the CF to be treated as a
"TRULY" mandatory field.
Check out the threads. I believe there is even a link to some of that
code.

Hope this helps.

Kenn
LBNL

On Mon, Apr 11, 2011 at 6:30 AM, Vance Walsh <[1] vance_walsh@concordacademy.org> wrote:

 What would be the proper string to make a Custom field Mandatory and

contain a date field?

 ---
 Vance Walsh
 Network and Systems Administrator
 Concord Academy - Concord, Mass.

I thought I had read somewhere that 3.8.8 had a Custom Field type option for Dates. I was
hoping this was true so I could throw away the Custom Code I am using that was contributed by
Emmanuel Lacour. Right now, the code works pretty well, other than I have no options to format
the data to be consistent with my date formatting preferences for other date fields.

This is not the case

If this is NOT the case, are there any plans to put the RT 4 code into 3.8.10?

This code has not been backported to 3.8 and is unlikely to be
backported since it was quite a bit of work to get right for 4.

-kevin

Kevin,

OK. Got it. Thanks for your time on this.

Kenn
LBNLOn Fri, Apr 15, 2011 at 10:24 AM, Kevin Falcone falcone@bestpractical.comwrote:

On Fri, Apr 15, 2011 at 09:51:34AM -0700, Kenneth Crocker wrote:

I thought I had read somewhere that 3.8.8 had a Custom Field type
option for Dates. I was
hoping this was true so I could throw away the Custom Code I am using
that was contributed by
Emmanuel Lacour. Right now, the code works pretty well, other than I
have no options to format
the data to be consistent with my date formatting preferences for
other date fields.

This is not the case

If this is NOT the case, are there any plans to put the RT 4 code into
3.8.10?

This code has not been backported to 3.8 and is unlikely to be
backported since it was quite a bit of work to get right for 4.

-kevin