Hi,
I'm new to XML and Java Script, i have been tasked to maintain a web application for a client and basically all that was required was a changed to SQL stored proc's and functions. I have ammended the stored procs and functions and tried a simulation run of the system . i get to a point were i can print out a copy of the quote that i requested. This data is all stored in the DB and is 100% correct. I have checked my results with the Backend results and get a match of a 100%.QuoteID in the DB is set as an int throughout. In the Main.asp page the QuoteID is Declared as Var QuoteID. This main page calls a save.js page that has the actual error. The xml does not get created as the JS page errors with the following :
============================================================
An error occured while processing the XML Request.
"Error converting datatype nvarchar to int.
QuoteID - undefined.
'null' is null or not an object
==========================================================
function BuildMisc(ParentNode) {
alert('ParentNode = ' + ParentNode)
var oParentNode = oMainXML.getElementsByTagName(ParentNode).item(0)
var oXML = new ActiveXObject("Msxml2.DOMDocument.3.0")
var oChild = oXML.createElement('MESSAGEID')
alert(QuoteID) -> returns a value of 12345 as expected
oChild.text = QuoteID
oParentNode.appendChild(oChild)
var oChild = oXML.createElement('ACTIONTYPE')
oChild.text = "NB"
oParentNode.appendChild(oChild)
alert('text3')
var oChild = oXML.createElement('POLICY')
oParentNode.appendChild(oChild)
}
==========================================================
The QuoteID that is parsed to the oChild.text = "null" according to the error received. However i did an alert befor the variable was parsed to the oChild element to see if the value was lost. It reflected as expected. When the value is parsed to oChild.text it crashes when the appendChild funtion is used and the error is "null is null or not an object". Is there a way i can do an alert to see the actual value of the oChild after the command oChild.text = QuoteID ? Why does it crash at this point? This code was in use +-3 years back and worked perfectly? any suggestions is welcome as i am relatively new and do not know much at all about XML's and JScript.
NB: The alerts were inserted as a debugging tool to see actual point of failure
Thanks for any help in advance.
I'm new to XML and Java Script, i have been tasked to maintain a web application for a client and basically all that was required was a changed to SQL stored proc's and functions. I have ammended the stored procs and functions and tried a simulation run of the system . i get to a point were i can print out a copy of the quote that i requested. This data is all stored in the DB and is 100% correct. I have checked my results with the Backend results and get a match of a 100%.QuoteID in the DB is set as an int throughout. In the Main.asp page the QuoteID is Declared as Var QuoteID. This main page calls a save.js page that has the actual error. The xml does not get created as the JS page errors with the following :
============================================================
An error occured while processing the XML Request.
"Error converting datatype nvarchar to int.
QuoteID - undefined.
'null' is null or not an object
==========================================================
function BuildMisc(ParentNode) {
alert('ParentNode = ' + ParentNode)
var oParentNode = oMainXML.getElementsByTagName(ParentNode).item(0)
var oXML = new ActiveXObject("Msxml2.DOMDocument.3.0")
var oChild = oXML.createElement('MESSAGEID')
alert(QuoteID) -> returns a value of 12345 as expected
oChild.text = QuoteID
oParentNode.appendChild(oChild)
var oChild = oXML.createElement('ACTIONTYPE')
oChild.text = "NB"
oParentNode.appendChild(oChild)
alert('text3')
var oChild = oXML.createElement('POLICY')
oParentNode.appendChild(oChild)
}
==========================================================
The QuoteID that is parsed to the oChild.text = "null" according to the error received. However i did an alert befor the variable was parsed to the oChild element to see if the value was lost. It reflected as expected. When the value is parsed to oChild.text it crashes when the appendChild funtion is used and the error is "null is null or not an object". Is there a way i can do an alert to see the actual value of the oChild after the command oChild.text = QuoteID ? Why does it crash at this point? This code was in use +-3 years back and worked perfectly? any suggestions is welcome as i am relatively new and do not know much at all about XML's and JScript.
NB: The alerts were inserted as a debugging tool to see actual point of failure
Thanks for any help in advance.