HELP please!!!
I'm currently migrating from 2003 to 2010 in both InfoPath and SharePoint terms. The form I'm migrating has a lot of jscript that I need to retain (re-write etc. would be too much and I don't really have the time!) so I'm extracting the files & maintaining it that way. The 2003 form had some code that read data from a sharepoint list that had been added as a data connection. The code to read from the sharepoint list is something like :-
var sectionName = "Project Management";
var gate1 = XDocument.GetDOM("Gate_functional_areas").selectSingleNode("//dfs:Gate functional areas[@Title = '" + sectionName + "']/@Gate 1 Mandatory").text;
// i.e. return from the list the value of Gate 1 mandatory when @Title = Project Management.
How can I do same with a 2010 setup?
I've tried
var gate1 = XDocument.GetDOM("Gate_functional_areas").selectSingleNode("//ns2:SharePointListItem_RW[ns2:Title = '" + sectionName + "']/ns2:Gate 1 Mandatory").text;
but it just doesn't work. I've got all my namespaces ok etc.
I've also tried setting the search criteria, query the data then read the value - still no joy.
XDocument.GetDOM("Gate_functional_areas").selectSingleNode("/dfs:myFields/dfs:queryFields/q:SharePointListItem_RW/q:Title").text = "Project Management";
XDocument.GetDOM("Gate_functional_areas").Query;
var gate1 = XDocument.GetDOM("Gate_functional_areas").selectSingleNode("//ns2:SharePointListItem_RW/ns2:Gate 1 Mandatory").text;
I've also tried inserting "_x0020_" for spaces in the value I'm trying to get hold of e.g. ns2:Gate_x0020_1_x0020_Mandatory - beacuse if you create an expression box to display a data item from the data connection this is what it does.
I really would appreciate some guidance as this is important and my backs to the wall to get this working!
Thanks.