Gossamer Forum
Home : Products : DBMan SQL : Discussion :

showing a field

Quote Reply
showing a field
We are ready to finally deploy our application system that was built on DB SQL.

There is one final enhancement that our HR department would like added that I cannot figure out how to do. The table that contains all the job postings is a relationship and the selection list is generated with


<%tempjobs%>
<select name="position">
<%loop lists%>
<option value="<%id%>"><%position%></option>
<%endloop%>
</select>

The %tempjobs% global is used to sort the list alphabetically:

sub {
my $tab = $DB->table('positions');
$tab->select_options("ORDER BY position");
return { lists => $tab->select({ active => "yes"})->fetchall_hashref };
}

The list generates fine. Whenever the user chooses their posting and submits it, it enters the ID number from the positions table into the position field in the hr table. ID is the primary key in the positions table.

The problem we are having is that on the add_success page, they would like a message displayed that reads:

“Thank you for applying. Your application id number is <%id%> and you have applied for <%position%>.”

When I did this, It displays both fields from the users input fine. However, instead of the position number, HR would like the user to see the name of the posting (position from the positions table). Is there anyway to have this done?

The site is now at http://apply.pps.k12.pa.us/admin/admin.cgi - i have removed the security from the admin panel for you if you want to take a look at it.
Quote Reply
Re: [afail77] showing a field In reply to
You may need the global template below to get the position:

sub {
my $id = shift;
my $rs = $DB->table('positions')->get($id);
return $rs->{position};
}

and <%global_name($id)%>

Hope that helps.

TheStone.

B.
Quote Reply
Re: [TheStone] showing a field In reply to
thank you so much!

It worked fine, I had it return position instead of ID when I called the global.