InfoPath run-time error

E

Euclid

I'm brand new to jscript, InfoPath and xml so bear with me. I was asked to
write some code modelled after code that works in another InfoPath
application. I'm getting an error when I preview the form that says:
'XDocument.DataObjects.questionMappings.DOM' is null or not an object
File:script.js
Line:13
questionMappings.xml is a secondary source which seems to be OK since it
opens properly in IE.
The actual line of code that errors out is:
var scoreData = XDocument.DataObjects["questionMappings"].DOM;
The same line seems to work just fine in the application I copied it from.
Does anyone have any idea what's going on?
 
S

S.Y.M. Wong-A-Ton

When you added the secondary data source to the InfoPath form template, did
you also name it "questionMappings"?
 
E

Euclid

Yes, under "Tools", "Resource Files..."; with the same spelling and
capitalization.

S.Y.M. Wong-A-Ton said:
When you added the secondary data source to the InfoPath form template, did
you also name it "questionMappings"?
---
S.Y.M. Wong-A-Ton


Euclid said:
I'm brand new to jscript, InfoPath and xml so bear with me. I was asked to
write some code modelled after code that works in another InfoPath
application. I'm getting an error when I preview the form that says:
'XDocument.DataObjects.questionMappings.DOM' is null or not an object
File:script.js
Line:13
questionMappings.xml is a secondary source which seems to be OK since it
opens properly in IE.
The actual line of code that errors out is:
var scoreData = XDocument.DataObjects["questionMappings"].DOM;
The same line seems to work just fine in the application I copied it from.
Does anyone have any idea what's going on?
 
S

S.Y.M. Wong-A-Ton

You need to add a data connection under Tools > Data Connections, not Tools >
Resource Files. That might be causing your error.
---
S.Y.M. Wong-A-Ton


Euclid said:
Yes, under "Tools", "Resource Files..."; with the same spelling and
capitalization.

S.Y.M. Wong-A-Ton said:
When you added the secondary data source to the InfoPath form template, did
you also name it "questionMappings"?
---
S.Y.M. Wong-A-Ton


Euclid said:
I'm brand new to jscript, InfoPath and xml so bear with me. I was asked to
write some code modelled after code that works in another InfoPath
application. I'm getting an error when I preview the form that says:
'XDocument.DataObjects.questionMappings.DOM' is null or not an object
File:script.js
Line:13
questionMappings.xml is a secondary source which seems to be OK since it
opens properly in IE.
The actual line of code that errors out is:
var scoreData = XDocument.DataObjects["questionMappings"].DOM;
The same line seems to work just fine in the application I copied it from.
Does anyone have any idea what's going on?
 
E

Euclid

That was the problem. I didn't know you had to add the file to both
locations. Thank you very much for giving me the solution.

S.Y.M. Wong-A-Ton said:
You need to add a data connection under Tools > Data Connections, not Tools >
Resource Files. That might be causing your error.
---
S.Y.M. Wong-A-Ton


Euclid said:
Yes, under "Tools", "Resource Files..."; with the same spelling and
capitalization.

S.Y.M. Wong-A-Ton said:
When you added the secondary data source to the InfoPath form template, did
you also name it "questionMappings"?
---
S.Y.M. Wong-A-Ton


:

I'm brand new to jscript, InfoPath and xml so bear with me. I was asked to
write some code modelled after code that works in another InfoPath
application. I'm getting an error when I preview the form that says:
'XDocument.DataObjects.questionMappings.DOM' is null or not an object
File:script.js
Line:13
questionMappings.xml is a secondary source which seems to be OK since it
opens properly in IE.
The actual line of code that errors out is:
var scoreData = XDocument.DataObjects["questionMappings"].DOM;
The same line seems to work just fine in the application I copied it from.
Does anyone have any idea what's going on?
 
S

S.Y.M. Wong-A-Ton

No worries.
---
S.Y.M. Wong-A-Ton


Euclid said:
That was the problem. I didn't know you had to add the file to both
locations. Thank you very much for giving me the solution.

S.Y.M. Wong-A-Ton said:
You need to add a data connection under Tools > Data Connections, not Tools >
Resource Files. That might be causing your error.
---
S.Y.M. Wong-A-Ton


Euclid said:
Yes, under "Tools", "Resource Files..."; with the same spelling and
capitalization.

:

When you added the secondary data source to the InfoPath form template, did
you also name it "questionMappings"?
---
S.Y.M. Wong-A-Ton


:

I'm brand new to jscript, InfoPath and xml so bear with me. I was asked to
write some code modelled after code that works in another InfoPath
application. I'm getting an error when I preview the form that says:
'XDocument.DataObjects.questionMappings.DOM' is null or not an object
File:script.js
Line:13
questionMappings.xml is a secondary source which seems to be OK since it
opens properly in IE.
The actual line of code that errors out is:
var scoreData = XDocument.DataObjects["questionMappings"].DOM;
The same line seems to work just fine in the application I copied it from.
Does anyone have any idea what's going on?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top