Maybe someone can help me with this... I have been beating my head against the wall for about 45 minutes and can't find the answer to this on the forum or in the help. I know you can do it, I just don't know how.
I am trying to add a function to the "Template Globals" that will be referenced from the detailed page with:
<%venue_title%>
I need the sub to return the "title" field from another table named "Venues". My problem is that I can't seem to reference any of the data in the Links table (specifically a field named "venueid" that I added ... or even ID for that matter) from within my sub. What am I missing? Here is what I have:
<PRE>
sub {
my %rec = @_;
my $ven_db = $DB->table('Venues');
my $sth = $obj->select({ ID => $rec{'VenueID'} });
if(my $row = $sth->fetchrow_hashref) {
return $row{'Title'};
}
return "Invalid Venue!";
}
</PRE>
From what I see in the docs, @_ (sub params) is set to a hashset of all the fields of the record that was opened for the current page. Is this not the case?
Thanks!
-Shaun
I am trying to add a function to the "Template Globals" that will be referenced from the detailed page with:
<%venue_title%>
I need the sub to return the "title" field from another table named "Venues". My problem is that I can't seem to reference any of the data in the Links table (specifically a field named "venueid" that I added ... or even ID for that matter) from within my sub. What am I missing? Here is what I have:
<PRE>
sub {
my %rec = @_;
my $ven_db = $DB->table('Venues');
my $sth = $obj->select({ ID => $rec{'VenueID'} });
if(my $row = $sth->fetchrow_hashref) {
return $row{'Title'};
}
return "Invalid Venue!";
}
</PRE>
From what I see in the docs, @_ (sub params) is set to a hashset of all the fields of the record that was opened for the current page. Is this not the case?
Thanks!
-Shaun