[rt-users] Default value

Mathew Snyder theillien at yahoo.com
Mon Sep 24 14:43:58 EDT 2007


I was wondering about that.  The code that Kenneth provided as an example uses
LoadByName instead of LoadByNameAndQueue.  That fixed it.  Thanks.

Mathew
Keep up with me and what I'm up to: http://theillien.blogspot.com


Stephen Turner wrote:
> 
> At Monday 9/24/2007 11:26 AM, you wrote:
>> Figured it out.  Seems that despite a CF being created as a Global, it
>> has to be
>> explicitly applied to a queue...strange.
>>
>>
>>
>> Mathew Snyder wrote:
>> > I have one DV that I set to a default value whenever a ticket is
>> created.  I've
>> > tried to port this over to another queue with a different CF/value
>> but it
>> > doesn't seem to work.  Here's the code:
>> >
>> > my $CFName = 'Environment';
>> > my $DefaultValue = 'default_value';
>> > my $RecTransaction = 1;
>> > my $QueueObj = $self->TicketObj->QueueObj;
>> > my $CFObj = RT::CustomField->new( $QueueObj->CurrentUser );
>> >
>> > $CFObj->LoadByNameAndQueue( Name => $CFName, Queue => $QueueObj->id );
>> >
> 
> Mathew,
> 
> If you supply a non-zero Queue arg to LoadByNameAndQueue, it will always
> look for a field tied to the queue. If you want to load the global CF,
> omit the Queue arg.
> 
> Steve
> 



More information about the rt-users mailing list