<html><head><style type='text/css'>body { font-family: 'Times New Roman'; font-size: 12pt; color: #000000}</style></head><body>Hi<br><br>I'm trying to create a drop down list when creating a new ticket. The value of the drop down list is supposed to be filled into a CF (this part I haven't gotten to yet).<br>I've taken inspiration from the Ticket/Create.html and Elements/SelectOwner, but I can't quite figure out the meaning of the Elements pages. I'm no perl expert - far from, but I've tried to put together a few lines in a new file Elements/SelectCustomer. But when I call it from the Create.html page, I just get a bunch of errors.<br>Any help on how I can proceed with this?<br><br>Thanks in advance.<br><br>Best regards<br>Tommy Abrahamsson<br><br>Errors:<br><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Error during compilation of /var/www/rt3/Elements/SelectCustomer:<br>Useless use of push with no values at /var/www/rt3/Elements/SelectCustomer line 75.<br>Type of arg 1 to push must be array (not hash element) at /var/www/rt3/Elements/SelectCustomer line 75, near "})"<br>Global symbol "@assetcustomers" requires explicit package name at /var/www/rt3/Elements/SelectCustomer line 50.</font><br><br>SelectOwner:<br><SELECT NAME="<%$Name%>"><br>%if ($DefaultValue) {<br><OPTION <% !$Default ? "SELECTED" : '' %> VALUE=""><%$DefaultLabel%></OPTION><br>%}<br>%foreach my $AssetCustomer ( @assetcustomers)  {<br><OPTION <% ($AssetCustomer->Id == $Default) ? "SELECTED" : ''%><br>%if ($ValueAttribute eq 'id') {<br>    value="<%$AssetCustomer->id%>"<br>%} elsif ($ValueAttribute eq 'Name') {<br>    value="<%$AssetCustomer->Name%>"<br>%}<br>><%$AssetCustomer->Name()%></OPTION><br>%}<br></SELECT><br><%INIT><br>my @objects;<br>my %assetcustomers;<br><br>my $assetobj = RTx::AssetTracker::Assets->new($session{CurrentUser});<br>$assetobj->FromSQL('Type = "Customers" AND Status != "retired"');<br><br>while (my $asset = $assetobj->Next)<br>{<br>        push ($assetcustomers{$asset});<br><br><br>}<br><br></%INIT><br><br><%ARGS><br>$QueueObj => undef<br>$Name => undef<br>$Default => 0<br>$User => undef<br>$TicketObj => undef<br>$DefaultValue => 1<br>$DefaultLabel => "-"<br>$ValueAttribute => 'id'<br>$cfqueues => undef<br></%ARGS><br><br></body></html>