I'm trying to update a Remedy ticket submission page, modifying the existing page and ARSPerl submission script to input trouble tickets, but am running into a problem on submit, that I don't understand. When I fill in all the data on the ticket, and click submit, I'm getting the "Error: Runtime Exception" message, which I don't understand. From what I can tell, it appears that the perl script is reading the information in from the form correctly, but is failing somewhere else. any assistance would be appreciated.
Here is the ticket page:
code:
<script language="JavaScript">
function doFillToday ()
{ <cfoutput>document.solticket.problemday.value = "#DateFormat(Now(), "mm/dd/yy")#";</cfoutput>
}
</SCRIPT>
<script language="JavaScript">
function combinedate ()
{
document.solticket.combinedtime.value= document.solticket.problemday.value + " " + document.solticket.problemhour.value
}
</script>
<head>
<title>PrimusLink Ticket Submission</title>
</head>
<body bgcolor="#cccc99" background="backgroundtemplate.jpg">
<p><IMG src="ticketsub.jpg" border=0 width="800" height="128"></p>
<form name=solticket action="KyleSubmit.pl" method="post" style="position: absolute; left: 80">
<INPUT width=151 height=34 type=hidden value="The time of the trouble is a required field." name=problemhour_required>
<INPUT type=hidden value="The <b>customer's name</b> is a required field." name=custfname_required>
<INPUT type=hidden value="The <b>customer's account number</b> is a required field." name=custaccount_required>
<TABLE width=616 align=center border=1 height="853">
<TR NOWRAP>
<TD width=684 height="32" colspan="5" bgcolor="#63380b">
<font color="#ffffff" face="Arial"><B>Please enter your contact information</B></font>
</TD>
</TR>
<TR NOWRAP>
<TD width=184 height="54" bgcolor="#cccc99"><font face="Arial"> <font size="2">Agent Name:<BR></font>
<INPUT name="repusername" required="Yes" size="20" ></font>
</TD>
<TD width=151 height="54" bgcolor="#cccc99"><font face="Arial"> <font size="2">Rep Number:<BR></font>
<INPUT name="repnumber" required="Yes" size="20" ></font>
</TD>
<TD width=337 height="51" colspan="3" bgcolor="#cccc99"> <font face="Arial"><font size="2">Your E-mail:<BR></font>
<INPUT name="repemail" required="Yes" size="20" ><font size="2">
<INPUT type=hidden value="Email address is a required field." name=repemail_required>
</font></font>
</TD>
</TR>
<TR NOWRAP>
<TD width=184 height="42" bgcolor="#cccc99"><font face="Arial"> <font size="2">Agent Location: <BR></font>
<INPUT name="replocation" required="No" size="20" ><font size="2"> </font></font></FONT>
</TD>
<TD width=151 height="42" bgcolor="#cccc99"><font face="Arial"> <font size="2">Your Phone Number:<BR></font>
<INPUT name="repphone" required="Yes" validate="telephone" size="20" ><font size="2"></font></font></FONT>
</TD>
<TD width=337 height="51" colspan="3" bgcolor="#cccc99"> <font face="Arial"><font size="2">Your
Internal Reference Number/Ticket Number:<BR></font>
<INPUT name="reptikno" required="No" size="20" ><font size="2">
</font></font>
</TD>
</TR>
<TR NOWRAP>
<TD width=684 colspan="5" height="1" bgcolor="#cccc99"> <font face="Arial"><font size="2">Do you want to be notified when this ticket is closed? </font>
<INPUT type=radio CHECKED value=email name=repnotify><font size="2">Yes </font>
<INPUT type=radio value="" name=repnotify><font size="2">No</font></font>
</TD>
</TR>
<TR NOWRAP>
<TD width=684 height="19" colspan="5">
</TD>
</TR>
<TR NOWRAP>
<TD width=684 height="32" colspan="5" bgcolor="#63380b"> <font color="#ffffff" face="Arial"><B>Customer Contact Information</B></font>
</TD>
</TR>
<TR NOWRAP>
<TD width=184 height="42" bgcolor="#cccc99"><font face="Arial"> <font size="2">Customer's First Name:<BR></font>
<INPUT maxLength=50 size=15 name=custfname><font size="2"> </font></font>
</TD>
<TD width=151 height="42" bgcolor="#cccc99"><font face="Arial"> <font size="2">Customer's Last Name:<BR></font>
<INPUT maxLength=50 size=15 name=custlname><font size="2"> </font></font>
</TD>
<TD width=295 height="84" bgcolor="#cccc99" rowspan="2"><font face="Arial"> <font size="2">Billing Number: (BTN)<BR></font>
<input type=text name=custbtn size=15></td>
<TD width=201 height="84" bgcolor="#cccc99" rowspan="2" colspan="2"><p align="center"> <font face="Arial">
<INPUT type=button name=action value="Copy BTN# to WTN#" onClick="this.form.custwtn.value=this.form.custbtn.value;">
</TD>
</TR>
<TR NOWRAP>
<TD width=184 height="42" bgcolor="#cccc99"><font face="Arial" size="2">Customer Business Name:</font><font face="Arial"><font size="2"><BR></font>
<input type=text name=custbname size=15>
</TD>
<TD width=151 height="42" bgcolor="#cccc99"><font face="Arial"> <font size="2">Account Number<BR></font>
<INPUT maxLength=25 size=15 name=custaccount><font size="2"> </font></font>
</TD>
</TR>
<TR NOWRAP>
<TD noWrap width=341 height=41 colspan="2" bgcolor="#cccc99"> <font face="Arial"><font size="2"> Which service is the customer reporting?<BR></font>
<SELECT size=1 name=custservicetype>
<OPTION value="" selected></OPTION>
<OPTION value?Dedicated Toll Free?>Dedicated Toll Free</OPTION>
<OPTION value?Switched Toll Free?>Switched Toll Free</OPTION>
<OPTION value?PIC 223 CNR?>Pic 223 CNR</OPTION>
<OPTION value?T-1?>T-1 Circuit</OPTION>
</SELECT><font size="2">
<INPUT type=hidden value="The <b>customer's service type</b> is a required field." name=custservicetype_required></font></font>
</TD>
<TD width=337 height="41" colspan="3" align="middle" bgcolor="#cccc99">
</TD>
</TR>
<TR NOWRAP>
<TD vAlign=bottom noWrap width=684 height=44 colspan="5"> <font face="Arial">
</TD>
</TR>
<TR NOWRAP>
<TD width=684 height="32" colspan="5" bgcolor="#63380b"> <font color="#ffffff" face="Arial"><B>Originating Information</B></font>
</TD>
</TR>
<TR NOWRAP>
<TD width=341 height=18 colspan=2 bgcolor="#cccc99"> <font face="Arial"><font size="2">Called From Area Code:<BR>
<INPUT type=hidden name=origcountryname> </font>
<SELECT onchange=this.form.origcountrycode.value=this.form.countrynamelist.value; size=1 name=countrynamelist>
<OPTION value="" selected></OPTION>
<OPTION value="1">USA</OPTION>
</SELECT></FONT>
</TD>
<TD width=295 bgColor=#cccc99 height=18><font face=Arial><font size=2>Called from CC: <BR></FONT>
<INPUT maxLength=25 size=15 name=origcountrycode></FONT>
</TD>
<TD width=201 bgColor=#cccc99 height=18 colspan="2"><font face="Arial"> <font size="2">Originating Number: (WTN) <BR></font>
<input type=text name=custwtn size=15>
</TD>
</TR>
<TR NOWRAP>
<TD width=341 bgColor=#cccc99 colSpan=2 height=1><font face=Arial><font size=2 >What symptom is being experienced?<BR></FONT>
<SELECT size=1 name=troublesymptom >
<OPTION value="" selected ></OPTION>
<OPTION value="Account Codes Not Working" >Account Codes Not Working</OPTION>
<OPTION value="Busy signal" >Busy signal</OPTION>
<OPTION value="Carrier direct billing">Carrier direct billing</OPTION>
<OPTION value="Constant tone">Constant tone</OPTION>
<OPTION value="Cut off">Cut off</OPTION>
<OPTION value="Dead Air/No sound">Dead Air/No sound</OPTION>
<OPTION value="Difficulty while dialing">Difficulty while dialing</OPTION>
<OPTION value="Error message" >Error message</OPTION>
<OPTION value="Fast busy signal">Fast busy signal</OPTION>
<OPTION value="Faxing difficulty">Faxing difficulty</OPTION>
<OPTION value="Line quality problem" >Line quality problem</OPTION>
<OPTION value="Long connect time">Long connect time</OPTION>
<OPTION value="Long disconnect">Long disconnect</OPTION>
<OPTION value="No long distance" >No long distance</OPTION>
<OPTION value="Not connecting">Not connecting</OPTION>
<OPTION value="Siren">Siren</OPTION>
<OPTION value="Terminating Number Problems">Terminating Number Problems</OPTION>
</SELECT></FONT>
</TD>
<TD width=337 bgColor=#cccc99 colSpan=3 height=1><font face=Arial><font size=2>Best time to Contact Customer<BR></FONT>
<SELECT size=1 name=custcontacttime width="25">
<OPTION value="" selected ></OPTION>
<OPTION value=0 >6am-9am</OPTION>
<OPTION value=1 >9am-5pm</OPTION>
<OPTION value=2 >5pm-10pm</OPTION>
<OPTION value=3 >other</OPTION>
</SELECT></FONT>
</TD>
</TR>
<TR NOWRAP>
<TD width=672 colSpan=5 height=19>
</TD>
</TR>
<TR NOWRAP>
<TD width=684 bgColor=#63380b colSpan=5 height=32 ><font face=Arial color=#ffffff><B>Trouble Information</B></FONT>
</TD>
</TR>
<TR NOWRAP>
<TD width=341 bgColor=#cccc99 colSpan=2 height=1 rowspan="2" ><font face=Arial size=2>Description of problem or Relevant Information: </FONT> <P><font face=Arial>
<TEXTAREA name=problemdescription rows=5 cols=40></TEXTAREA></FONT></P>
</TD>
<TD width=337 bgColor=#cccc99 colSpan=3 height=1 ><font face=Arial><font size=2 >When is the Problem occuring? </FONT>
<SELECT size=1 name=problemscope>
<OPTION value="" selected ></OPTION>
<OPTION value=0>All Calls</OPTION>
<OPTION value=1>Only When Calling the Terminating Destination</OPTION>
<OPTION value=2>Only When Calling the Terminating Number</OPTION>
</SELECT><font size=2>
</TD>
</TR>
<TR NOWRAP>
<TD width=337 bgColor=#cccc99 colSpan=3 height=22 >
<font face="Arial" size="2">What is the Frequency of the Problem?</font><font face=Arial> <SELECT size=1 name=problemfrequency>
<OPTION value="" selected ></OPTION>
<OPTION value=0>Constant</OPTION>
<OPTION value=1>Intermittent</OPTION>
</SELECT></FONT></TD>
</TR>
<TR NOWRAP>
<TD width=672 colSpan=5 height=19>
</TD>
</TR>
<TR NOWRAP>
<TD width=684 bgColor=#63380b colSpan=5 height=32 ><font face=Arial color=#ffffff><B>Called To Country Information </B><font face="Arial" size="2">(Required for Switched 1+ Problems)</FONT></FONT>
</TD>
</TR>
<TR NOWRAP>
<TD width=341 bgColor=#cccc99 colSpan=2 height=30 ><font face=Arial><font size=2 >Called to Country:<BR >
<INPUT type=hidden name=destcountry > </FONT>
<SELECT onchange=this.form.destcountrycode.value=this.form.destcountrylist.value; size=1 name=destcountrylist>
<OPTION value="" selected ></OPTION>
<OPTION value=1>USA</OPTION>
</SELECT></FONT>
</TD>
<TD width=396 bgColor=#cccc99 height=30 colspan="2"><font face=Arial><font size=2>Called to CC:<BR ></FONT>
<INPUT maxLength=50 onchange=this.form.origcountrycode.value=this.form.countrynamelist.value; size=15 name=destcountrycode><font size=2> </FONT></FONT>
<font size=2 face="Arial"> </FONT></TD>
<TD width=100 bgColor=#cccc99 height=30><font face=Arial><font size=2>Called to Number:<BR ></FONT>
<INPUT maxLength=25 size=15 name=destnumber ></FONT></TD>
</TR>
<TR NOWRAP>
<td width="151" height="42"nowrap><b>Date of Trouble:</b><br>mm/dd/yy<br>
<input name="problemday" default="mm/dd/yy 00:00:00 AM or PM" type="text" maxlength="50" size="15" required="Yes" onchange="combinedate();">
<input type="hidden" name="problemday_required" value="The date of the trouble is a required field.">
<input type="button" value="today" onClick="doFillToday();">
</td>
<TD width=50 bgColor=#cccc99 height=34><font face=Arial><font size=2>Time of Trouble:<BR ></FONT>
<SELECT width=151 height=34 maxLength=15 size=1 name=problemhour required="Yes" size=1 onchange="combinedate();"> ><font size=2>
<OPTION value="" selected ></OPTION>
<OPTION value="12:00 AM" >12:00 AM</OPTION>
<OPTION value="12:30 AM" >12:30 AM</OPTION>
<OPTION value="1:00 AM" >1:00 AM</OPTION>
<OPTION value="1:30 AM" >1:30 AM</OPTION>
<OPTION value="2:00 AM" >2:00 AM</OPTION>
<OPTION value="2:30 AM" >2:30 AM</OPTION>
<OPTION value="3:00 AM" >3:00 AM</OPTION>
<OPTION value="3:30 AM" >3:30 AM</OPTION>
<OPTION value="4:00 AM" >4:00 AM</OPTION>
<OPTION value="4:30 AM" >4:30 AM</OPTION>
<OPTION value="5:00 AM" >5:00 AM</OPTION>
<OPTION value="5:30 AM" >5:30 AM</OPTION>
<OPTION value="6:00 AM" >6:00 AM</OPTION>
<OPTION value="6:30 AM" >6:30 AM</OPTION>
<OPTION value="7:00 AM" >7:00 AM</OPTION>
<OPTION value="7:30 AM" >7:30 AM</OPTION>
<OPTION value="8:00 AM" >8:00 AM</OPTION>
<OPTION value="8:30 AM" >8:30 AM</OPTION>
<OPTION value="9:00 AM" >9:00 AM</OPTION>
<OPTION value="9:30 AM" >9:30 AM</OPTION>
<OPTION value="10:00 AM" >10:00 AM</OPTION>
<OPTION value="10:30 AM" >10:30 AM</OPTION>
<OPTION value="11:00 AM" >11:00 AM</OPTION>
<OPTION value="11:30 AM" >11:30 AM</OPTION>
<OPTION value="12:00 PM" >12:00 PM</OPTION>
<OPTION value="12:30 PM" >12:30 PM</OPTION>
<OPTION value="1:00 PM" >1:00 PM</OPTION>
<OPTION value="1:30 PM" >1:30 PM</OPTION>
<OPTION value="2:00 PM" >2:00 PM</OPTION>
<OPTION value="2:30 PM" >2:30 PM</OPTION>
<OPTION value="3:00 PM" >3:00 PM</OPTION>
<OPTION value="3:30 PM" >3:30 PM</OPTION>
<OPTION value="4:00 PM" >4:00 PM</OPTION>
<OPTION value="4:30 PM" >4:30 PM</OPTION>
<OPTION value="5:00 PM" >5:00 PM</OPTION>
<OPTION value="5:30 PM" >5:30 PM</OPTION>
<OPTION value="6:00 PM" >6:00 PM</OPTION>
<OPTION value="6:30 PM" >6:30 PM</OPTION>
<OPTION value="7:00 PM" >7:00 PM</OPTION>
<OPTION value="7:30 PM" >7:30 PM</OPTION>
<OPTION value="8:00 PM" >8:00 PM</OPTION>
<OPTION value="8:30 PM" >8:30 PM</OPTION>
<OPTION value="9:00 PM" >9:00 PM</OPTION>
<OPTION value="9:30 PM" >9:30 PM</OPTION>
<OPTION value="10:00 PM" >10:00 PM</OPTION>
<OPTION value="10:30 PM" >10:30 PM</OPTION>
<OPTION value="11:00 PM" >11:00 PM</OPTION>
<OPTION value="11:30 PM" >11:30 PM</OPTION>
</SELECT></FONT></FONT></TD>
<TD width=540 bgColor=#cccc99 height=34 colspan="3"><font face=Arial><font size=2 >Time Zone:<BR></FONT>
<SELECT size=1 name=problemtimezone>
<OPTION value="" selected ></OPTION>
<OPTION value=3>GMT</OPTION>
<OPTION value=1>EST</OPTION>
<OPTION value=0>CST</OPTION>
<OPTION value=5>MST</OPTION>
<OPTION value=2>PST</OPTION>
</SELECT><fontsize=2><!--input type="button" value="Zone Help"-->
</FONT>
<fontsize=2>
<INPUT onclick="window.open('http://208.219.5.129/TagsReplinkSite/Other/timezone.htm', 'TZ');" type=button value=" Time Zone Help" name=TZHelp></FONT>
</TD>
</TR>
<TR NOWRAP>
<TD width=183 bgColor=#cccc99 height=42> <p align=center><font face=Arial>
<INPUT onclick=history.back() type=button value=Back></FONT></P>
</TD>
<TD width=324 bgColor=#cccc99 height=42 colspan="2">
<p align="center"><font face=Arial>
<INPUT type=submit value="Submit Ticket"></FONT>
</TD>
</TR>
</TABLE>
</form>
</body>
</html>
and here's the perl submit script.
code:
#!/usr/local/bin/perl
use CGI qw/:standard/; # load standard CGI routines
use CGI::Carp; # load CGI error routines
use CGI::Carp qw(fatalsToBrowser); # send errors to the browser
use ARS; # load Remedy libs
#check for required fields
@missing = ();
foreach $key (param) {
if ( $key =~ /(.*)_required/ ) {
@values = param($key);
if ( length(param($1)) == 0 ) {
push(@missing,param($key));
}
}
};
#were there any missing fields?
if ( @missing ) {
#print error message
print header;
print start_html( -title=>'Form Entries Incomplete or Invalid',
-style=>{-type=>'text/css',-src=>'/SOL/stylesheet.css'}
);
print "<HR><H3>Form Entries Incomplete or Invalid</H3>One or more problems exist with the data you have entered.<UL>";
foreach (@missing) {
print "<LI>";
print;
print "<p>";
};
print "</UL>Use the <I>Back</I> button on your web browser to return to the previous page and correct the listed problems.<P>";
print "<hr>";
print end_html;
exit;
}
#set up HTML stuff
print header;
print start_html( -title=>'Ticket Submit',
-style=>{-type=>'text/css',-src=>'stylesheet.css'}
);
#Now submit ticket to ARS
#set variables
$server = "11.1.3.72";
$user = "cwwebuser";
$pass = "cwwebuser";
#login to remedy server
if ( !($c = ars_Login( $server, $user, $pass )) ) {
print h1("Remedy Login Failed:");
print h2("Server: $server<br>User Name: $user");
print h3("$ars_errstr");
print '<br><input type="button" value="Back" onclick="history.back()">';
exit -1;
}
#submit ticket
if ( !($entry_id = ars_CreateEntry( $c, "AA-Voice Trouble Ticket",
7, 0,
536871092, param(repusername),
536871182, param(repnumber),
536870926, param(repemail),
536871179, param(replocation),
536871093, param(repphone),
536871209, param(reptikno),
536871096, param(repnotify),
536870923, param(custfname),
536870922, param(custlname),
536870931, param(custbtn),
536870925, param(custbname),
536870929, param(custaccount),
536870928, param(custservicetype),
536871181, param(origcountryname),
536871180, param(origcountrycode),
536870940, param(custwtn),
536870952, param(troublesymptom),
536871339, param(problemdescription),
536870954, param(problemscope),
536870941, param(destcountry),
536870937, param(destcountrycode),
536870942, param(destnumber),
536871035, param(combinedtime),
536871120, param(problemtimezone),
2, "WebUser",
)
) ) {
print h1("Remedy Ticket Submit Failed");
print h2("Server: $server<br>");
print h3("$ars_errstr");
print '<input type="button" value="Back" onclick="history.back()">';
exit -1;
};
#Ticket submittal was a success, print info
print h1("Thank you!");
print startform(-method=>"POST", -action=>"/sol/vsol_2.cfm");
print table({-border=>1, -width=>'100%'},
Tr({},
[td([' Your Ticket Number is:' , $entry_id ])]
)
);
# create hidden fields to carry over all values
#foreach $key (param) {
# #print "<STRONG>$key</STRONG> -> ";
# @values = param($key);
# #print join(", ",@values),"<BR>\n";
# print hidden($key,@values);
# };
#
#print submit('Action','Open Another Ticket');
#print '<br><a href="http://replink.telegroup.com/"><img border="0" src="http://10.40.70.71/TagsIntranetSite/images/backrp.gif" width="150" height="25" alt="" style="HEIGHT: 28px; WIDTH: 152px"></a>';
#print endform;
#debug info
print "<HR>";
print h3("Ticket Summary");
print "<p><h4>";
print "Ticket ID -> $entry_id<BR>\n";
foreach $key (param) {
if (( $key =~ /(.*)_required/ ) || ( $key =~ /(.*)_list/ )) {
# don't print this one
} else {
@values = param($key);
print "$key -> ", join(", ",@values),"<BR>\n";
};
};
print "</h4>";
#end HTML stuff
print end_html;