Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Script to lookup data not working
We need to pull data from an internal system. I set-up an asp page to write the required xml out when queried, and wrote a script to link to a button to grab the data from the xml and write it to the form.
It is not working
Script
var xmlHttp function showPartData() { xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; } var url="http://www.newpiper.net/rss_data/partdata.asp"; url=url+"?BAAN_SALES_ORDER_NUM="+document.main_form.custrecord_baan_sales_order_number.value; url=url+"&PART_NUM="+document.main_form.custrecord_part_number.value; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function stateChanged() { if (xmlHttp.readyState==4) { var xmlDoc=xmlHttp.responseXML.documentElement; document.main_form.custrecord_part_desc.value=xmlDoc.getElementsByTagName("ITEM_DESC")[0].childNodes[0].nodeValue; document.main_form.custrecord_part_dealer_net.value=xmlDoc.getElementsByTagName("PRICE_CALC_DEALER_NET_PRICE")[0].childNodes[0].nodeValue; document.main_form.custrecord_part_cost.value=xmlDoc.getElementsByTagName("PRICE_CALC_STD_COST_PRICE")[0].childNodes[0].nodeValue; document.main_form.custrecord_part_list.value=xmlDoc.getElementsByTagName("PRICE_CALC_LIST_PRICE")[0].childNodes[0].nodeValue; document.main_form.custrecord_part_operator.value=xmlDoc.getElementsByTagName("PRICE_CALC_OPERATOR_NET_PRICE")[0].childNodes[0].nodeValue; } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; }
0