function getToLocation(company, location, item) { var to_location=""; var s = ""; var a = 0; var sReturn = ""; var objhttp = null; var date_field = ""; var time_field = 999999; var tran_counter = 999999; if (tranMagic.FC=="+") { // capture the date field(out9) and the time_field(out10) for the last detail line populated. for (a=0;a<12;a++){ date_field = lawForm.getFormValue("out9", a); if (date_field == ""){ date_field = lawForm.getFormValue("out9", a-1); time_field = lawForm.getFormValue("out10", a-1); }else{ date_field = lawForm.getFormValue("out9", a); time_field = lawForm.getFormValue("out10", a); } alert("Loc date = " + date_field); alert("Time date = " + time_field); } }else{ date_field = lawForm.getFormValue("out9", 0); time_field = lawForm.getFormValue("out10", 0); }
if (company !== "") { if (location !== "") { if (item !== "") { s = portalWnd.DMEPath; s += "?PROD="+strPDL; s += "&FILE=ICTRANS"; s += "&FIELD=FROM-TO-LOC"; if (tranMagic.FC=="+"||tranMagic.FC=="-") { if (date_field !== "") { s += "&INDEX=ICTSET2&KEY=" + company + "=" + location + "=" + item + "=" + date_field + "=" + time_field + "=" + tran_counter; }else{ s += "&INDEX=ICTSET2&KEY=" + company + "=" + location + "=" + item; } }else{ s += "&INDEX=ICTSET2&KEY=" + company + "=" + location + "=" + item; } s += "&OUT=CSV&MAX=12&DELIM=~&NOHEADER"; alert("Loc S1 = " + s); objhttp = portalWnd.objFactory.createInstance("http"); objhttp.Open("GET",s,false); objhttp.Send("UserInfo"); sReturn=objhttp.responseTEXT; // DME Error Checking if(!sReturn||sReturn.status) { var msg="Error calling DME, "; msg += (sReturn? "(status code): "+sReturn.status: "bad server response."); alert(msg); return true; } var aData = new Array(); var aRecs = new Array(); var i=0;
if (sReturn !== "") { alert("Location = " + sReturn); while(sReturn.search("\r")>-1){ sReturn = sReturn.replace(/\r/g,""); } aRecs = sReturn.split("\n"); aRecs.pop(); for (i=1;i aFields = aRecs.split("~"); aData[aData.length] = new Array(aFields[0]); } for (x=0;x //alert(aData[x]); lawForm.setFormValue("text7", aData[x], x); } } }
} } }