-
Thank you, but all that code does is assign the value "/dfs:myFields/dfs:dataFields/d:Buyers/d:WorkOrders/@ALCOUN " to that field.
I'm pretty sure that if all you want to do is assign the user name to that field you can use a rule the way I described and skip using code altogether.
-
Remove the line that uses System.Environment.UserName from your code
Place a button on the form in the designer.
Double-click the button.
Click Rules...
Click Add...
Click Add action...
Select "Set a field's value"
Select the /dfs:myFields/dfs:dataFields/d:Buyers/d:WorkOrders/@ALCOUN field
Click ...
-
You can use C# with the 2003 OM (note my previous post saying to select "C# (2003 Object Model)".
But the 2007 one is just as good, if not better. My guess is that you are getting that error because of this line:
System.Environment.UserName;
Your form probably needs to be full trust to access System.Environment, but you ...
-
If you would like to try programming with the InfoPath 2003 object model and try out the code involving thisXDocument that you seem to be finding, you can switch to that by going to Tools->Form Options->Programming, clicking Remove Code and selecting C# (2003 Object Model).
-
What type of function is this code in? You will not be able to change a node value in a Changing or Validating event.
-
Code for this would not require iteration. It would look like this:
XPathNavigator iLoveSharePointSource = DataSources["GetGroupsFromCurrentUser"].CreateNavigator();
if (iLoveSharePointSource.SelectSingleNode("//s1:UserGroups[s1:string = 'Human Resources']", NamespaceManager) != null)
{
...
-
I can only guess, but it seems that InfoPath interperets newlines as soft returns (<br/>) when you paste data into a Rich Text Box. If you press Shift+Enter while typing in a rich text box it will insert a <br/> there too.
What would you prefer it do instead of using <br/>s?
-
Cool. We use CabLib in our solutions here at Qdabra, and while it has a few flaws and its error messages aren't great, it tends to get the job done.
Best of luck.
-
I don't understand your situation entirely, as in how exactly you are using these InfoPath files, but I will answer it as well as I can.
The .NET foundation classes, to the best of my knowledge, do not provide any good functionality for CAB extraction and that requires an external library. One such library is CABLIB, which is free to ...
-
It will be difficult to help you without some more information about how you are implementing the Show/Hide functionality.