[rt-users] re-set date field

Kenneth Crocker kfcrocker at lbl.gov
Mon Aug 30 14:23:21 EDT 2010


Kevin,

I don't understand. The CF is a "Select date" and th3e code is as follows:

# re-set the CF "Work-Completed Date" if it exists

my $ticket = $self->TicketObj;
my $trans = $self->TransactionObj;
my $cf_obj = RT::CustomField->new($RT::SystemUser);
my $new_value = 0;
my $cf_name = "Work-Completed Date";
my $Completed_Date = $ticket->FirstCustomFieldValue('Work-Completed Date');

if  ($Completed_Date)
    {
     $cf_obj->LoadByName(Name=>$cf_name);
     $RT::Logger->debug("Loaded\$cf_obj->Name = ". $cf_obj->Name() ."\n");
     $ticket->AddCustomFieldValue(Field=>$cf_obj, Value=>$new_value,
RecordTransaction=>0);
    }

I'm not sure what it is I should do differently.

Thanks.

Kenn
LBNL

On Mon, Aug 30, 2010 at 9:57 AM, Kevin Falcone <falcone at bestpractical.com>wrote:

> On Mon, Aug 30, 2010 at 09:15:17AM -0700, Kenneth Crocker wrote:
> >    The code doesn't blow up (with a simple 0), but I get 1970 on all my
> search results. I need to
> >    get rid of that somehow. Any ideas? Thanks.
> > >      0 should be fine, depends on how you're setting the date
>
> The key part of my statement is "Depends on how you're setting the
> date"
>
> -kevin
>
>
> RT Training in Washington DC, USA on Oct 25 & 26 2010
> Last one this year -- Learn how to get the most out of RT!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100830/e0e67769/attachment.htm>


More information about the rt-users mailing list