My version is 3.6.4
I'm working on a script to update users' data from LDAP. Everything is
working fine for the most part, but updating a custom field.
If I use code like this, the value is "updated"...
my $CFObj = new RT::CustomField($RT::SystemUser);
$CFObj->Load('Department');
$UserObj->AddCustomFieldValue (
Field => $CFObj->id,
Value => $department,
RecordTransaction => 1
);
The problem with this approach is that it doesn't update the record, it
creates new record and disables the old value.
So, I'm attempting the update the record like this...
my $CFs = $UserObj->CustomFields;
while (my $CF = $CFs->Next){
if ($CF->Name eq 'Department'){
my @cfAttribs = ('CONTENT');
my %cfArgs = {
CONTENT => $ARGS{'Department'}
};
my @results = $CF->Update(
Attributes => [EMAIL PROTECTED],
ARGSRef => \%cfArgs
);
last;
}
}
... which is not updating the record.
I've dug through the wiki and through the mailing list, but all examples
I've found use the AddCustomFieldValue method.
Any Suggestsion
Craig Patterson
Application Developer
Northrop Grumman IT/City of Grand Rapids
[EMAIL PROTECTED]
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com