Please help with this error - InfoPath Dev Sign in | Join | Help in General InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » General » Please help with this error Please help with this error Last post 03-26-2007 07:25 AM by B.Shiva Prasad. 8 replies. Page 1 of 1 (9 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 03-26-2007 05:59 AM edove Joined on 08-21-2006 Posts 50 Please help with this error Reply Contact Hi,I'm trying to call the code below from a button on my form and for some reason I keep getting this error:"'XDocument.DOM.selectSingleNode(...)' is null or not an object"The code:function btnCosting::OnClick(eventObj){var clicked = XDocument.UI.Confirm("You will not be able to undo this operation. Do you wish to continue?",1);if(clicked == 1) {XDocument.DOM.selectSingleNode("/my:myFields/my:header/my:costingsComplete").text = 1;}}I can't understand why.. 03-26-2007 06:19 AM In reply to K.Ramana Reddy Joined on 04-27-2005 India Posts 195 Re: Please help with this error Mark as Not AnswerMark as Answer... Reply Contact Hi,Check once, this Xpath is correct("/my:myFields/my:header/my:costingsComplete"):I hope this will help for you. K.Ramana Reddy / http://www.ggktech.comIndia. 03-26-2007 06:23 AM In reply to edove Joined on 08-21-2006 Posts 50 Re: Please help with this error Mark as Not AnswerMark as Answer... Reply Contact Well this is what I get if I go to the field under Data Sources and select Copy XPath. The field is in a group called Header under myFields. 03-26-2007 06:43 AM In reply to nukkumatti Joined on 12-08-2005 Germany Posts 349 Re: Please help with this error Mark as Not AnswerMark as Answer... Reply Contact Try to delete the first "/" in front of my:myFields.You can actually always use an Expression Box to find out the correct xPath. Just put the ExBox to your form, point it to the control/node you want to know the xPath for and then check the "Advanced - edit xPath" check box. Listen to Motörhead cos they play Rock'n Roll :) 03-26-2007 06:47 AM In reply to K.Ramana Reddy Joined on 04-27-2005 India Posts 195 Re: Please help with this error Mark as Not AnswerMark as Answer... Reply Contact Hi,I think, In Xpath you typed as "header", but in datasource it is "Header".Please correct it, then it will work for you.I hope this will work for you. K.Ramana Reddy / http://www.ggktech.comIndia. 03-26-2007 06:57 AM In reply to edove Joined on 08-21-2006 Posts 50 Re: Please help with this error Mark as Not AnswerMark as Answer... Reply Contact Ok I tried removing the initial "/" - same result.According to the exBox the xPath is this "my:header/my:costingsComplete", this didn't work either.Also changed "header" to Header but that didn't work. The group "header" is one I created and it doesn't have a capital "H" so it should be as typed.Thanks for everyones help so far. I also have the exact same code below trying to do the same thing with a different field. It always prompts but then can't seem to find the field. 03-26-2007 07:02 AM In reply to K.Ramana Reddy Joined on 04-27-2005 India Posts 195 Re: Please help with this error Mark as Not AnswerMark as Answer... Reply Contact Hi,I tried with code you have given, it is worked for me, (i.e,i did not get any error). K.Ramana Reddy / http://www.ggktech.comIndia. 03-26-2007 07:23 AM In reply to edove Joined on 08-21-2006 Posts 50 Re: Please help with this error Mark as Not AnswerMark as Answer... Reply Contact Still doesn't work for me for some reason! 03-26-2007 07:25 AM In reply to B.Shiva Prasad Joined on 01-19-2007 India Posts 102 Re: Please help with this error Mark as Not AnswerMark as Answer... Reply Contact hi edove,put "/" initially and try to write the XPath manually once, with case sensitive. I worked around with your specification and is working for me. B.Shiva PrasadInfoPath Dev, http://www.ggktech.comIndia Page 1 of 1 (9 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.