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.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Please note that on Saturday, April 18, 2026, at 8:00 PM Pacific Time, our Case Management System will undergo a scheduled maintenance for approximately 15 minutes. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
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