'Aloha!
In my standalone program I would like to do a join on the tables
Transactions and Users in order to add Users.Name to my print
out. (and not just the user number)
But I somehow lost track while trying to figure out how it is done
in the RT code itself.
Below is a boiled down demo program which fails in the second
last line, which is somehow expected.
RT::Transaction::Name Unimplemented in main. (./Join-demo-2 line 31)
Perhaps somebody can help me in the right direction.
--
/Morten %-)
#!/usr/bin/perl
package RT;
our $DatabaseType = 'mysql';
our $DatabaseUser = 'rtuser';
our $DatabasePassword = 'wibble';
our $DatabaseName = 'rtdb';
package main;
use strict;
use warnings;
use lib '/usr/share/request-tracker3.6/lib';
use RT;
use RT::Transactions;
RT::Init();
my $CurrentUser = RT::CurrentUser->new('cust-12345');
my $t = new RT::Transactions($CurrentUser);
$t->LimitToTicket(1);
my $u = $t->NewAlias('Users');
$t->Join(ALIAS1 => 'main',
FIELD1 => 'Creator',
ALIAS2 => $u,
FIELD2 => 'id');
while (my $row = $t->Next)
{
printf "id:%s, CreatorId:%s, Name:%s\n", $row->id, $row->Creator,
$row->Name;
}
_______________________________________________
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