-
I forgot the namespace manager, so more like:
Dim field As XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:biz", NamespaceManager)
field.SetValue(biz)
The stuff in bold needs to be the exact xpath to your field. If you right click the field in the data source task pane and select Copy XPath, it will ...
-
Just get your main data source field value the way you have other main data source fields in your script:
var field = XDocument.DOM.selectSingleNode("/my:myFields/my:TopLevelInput");
Then, you can do something like this:
query.text = "<query><filter><eq><column name='Title'/><value>" + ...
-
Hi--
It looks like you are passing in the input parameter....but not doing anything with it. Do you want to set a form field's value to your string variable biz?
Like this:
Dim field As XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:fieldIWantToFill")
field.SetValue(biz)
-
Hi, Gerry:
You say:
I'm guessing the appropriate avoidance behaviour is to be careful where one creates the .xsn in the first place.
My strategy for future .xsn files is to create the .xsn in exactly the same folder structure as will exist on the target hosts to which it will be deployed.
But with InfoPath, we ...
-
For example:
var query = XDocument.GetDOM("GetListItemsStr").selectSingleNode("/dfs:myFields/dfs:queryFields/tns:GetListItemsStr/tns:query");
query.text = "<query><filter><eq><column ...
-
And you used the publishing wizard to publish the form to the form library?
Or rather, I should ask, where are your users accessing the form from?
-
Hi:
Open your form in design mode. In InfoPath 2007, you can go to Tools > Form Options > Security and Trust (probably some place similar in 2003, I just don't remember, I'm afraid), you can change the trust settings. I usually let IP 'Automatically determine security level' but you may want to try setting the level to ...
-
Your script is different from my sample. You are selecting the text of the node. If the node is null, you'll get an object required error when you try to select text.
So, what you have:
var field11 = newTestDetails.selectSingleNode("my:field11");
...
-
Hey, could you also post the most recent copy of your script, in case there is something else going wrong? Because the field should be there, even if it doesn't have data...so it seems like something else might be the problem.
-
To test for whether a field is null, using the node variable declared in your while loop:
var field = node.selectSingleNode("Diameter");
if (null == field)
{
//do something
}
else
{
//do something else
}