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