<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SharePoint Integration</title><link>https://www.infopathdev.com:443/forums/46.aspx</link><description> For questions concerning issues in the integration of SharePoint and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Validating against Share Point login</title><link>https://www.infopathdev.com:443/forums/thread/15632.aspx</link><pubDate>Wed, 24 Aug 2005 17:46:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15632</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15632.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=15632</wfw:commentRss><description>probably the namespace is dns or something so the my: won't work. try without the my for the previous one (i.e. just ns1:). &lt;br /&gt;&lt;br /&gt;you shouldn't add another field to the data source created from the connection; just set a field that already exists in there and see if it works.&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: Validating against Share Point login</title><link>https://www.infopathdev.com:443/forums/thread/15631.aspx</link><pubDate>Wed, 24 Aug 2005 16:31:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15631</guid><dc:creator>markperry</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15631.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=15631</wfw:commentRss><description>Here's another example; if I design a new form and use an SQL database connection as the main connection, I get the following data source structure:&lt;br /&gt;&lt;br /&gt;myFields&lt;br /&gt;---&amp;gt; queryFields&lt;br /&gt;        ---&amp;gt; some fields&lt;br /&gt;---&amp;gt; dataFields&lt;br /&gt;        ---&amp;gt; some fields&lt;br /&gt;&lt;br /&gt;OK, so if I right click on myFields and add a text box (calling it employee) the program adds it to the dataFields group.&lt;br /&gt;&lt;br /&gt;So now the Xpath for the System.Environment.Username onLoad event should be:&lt;br /&gt;&lt;br /&gt;"my:myFields/my:dataFields/my:employee"&lt;br /&gt;&lt;br /&gt;shouldn't it? Except that the text box (employee) that I want to populate with System.Environment.Username remains frustratingly empty. I'm following the example given in Lab 15 on the MSDN site and trying to modify it to take into account the data connection.</description></item><item><title>Re: Validating against Share Point login</title><link>https://www.infopathdev.com:443/forums/thread/15630.aspx</link><pubDate>Wed, 24 Aug 2005 10:04:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15630</guid><dc:creator>markperry</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15630.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=15630</wfw:commentRss><description>Yeah, I'll try to calm down.&lt;br /&gt;&lt;br /&gt;I've been getting the username to work in projects where I haven't been adding the web service as the main data source.&lt;br /&gt;&lt;br /&gt;So I guess that if I tried to add the web service submit as a secondary data source instead, that might work? Don't know until I try.&lt;br /&gt;&lt;br /&gt;I did actually try what you suggested - modify the XPath to reflect the imported schema from the web service. The schema is as follows:&lt;br /&gt;&lt;br /&gt;myFields&lt;br /&gt;dataFields&lt;br /&gt;tns:ReceiveDataSetResponse&lt;br /&gt;ReceiveDataSetResult&lt;br /&gt;ns1:DataSet1&lt;br /&gt;(choice)&lt;br /&gt;dooraccessrequest&lt;br /&gt;fieldnames(x13)&lt;br /&gt;&lt;br /&gt;So I edited the XPath but it fell over because it didn't like the extra ':'. For example, I wrote&lt;br /&gt;&lt;br /&gt;IXMLDOMNode nodeEmployee = thisXDocument.DOM.selectSingleNode("my:myFields/my:dataFields/my:tns:ReceiveDataSetResponse/.../");&lt;br /&gt;&lt;br /&gt;but the compiler didn't like the extra : after tns. &lt;br /&gt;&lt;br /&gt;Appreciate the help.&lt;br /&gt;</description></item><item><title>Re: Validating against Share Point login</title><link>https://www.infopathdev.com:443/forums/thread/15629.aspx</link><pubDate>Wed, 24 Aug 2005 05:27:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15629</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15629.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=15629</wfw:commentRss><description>Hi again,&lt;br /&gt;Hmmm. This seems pretty simple. If you are setting up your form to submit from the main data source (#1) then the xpath in your code to populate from System.Environment.Username (#2) isn't correct. It will have to change to reflect the schema that was created for the main data source when you created your form to point to your Web service. This is a really simple thing to do, so it should be easy to figure out. Have patience...&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: Validating against Share Point login</title><link>https://www.infopathdev.com:443/forums/thread/15628.aspx</link><pubDate>Tue, 23 Aug 2005 08:08:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15628</guid><dc:creator>markperry</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15628.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=15628</wfw:commentRss><description>OK, replies in order:&lt;br /&gt;&lt;br /&gt;1. Yes, I'm using the main data source for the database connection. I'm setting it up by enabling Submit on the form and then pointing the submit to the web service that I've written. This then puts the schema for the web service into the Data Source.&lt;br /&gt;&lt;br /&gt;2. I'm populating the field from AD in the following way:&lt;br /&gt;a) Creating a C# InfoPath project in Visual Studio 2003&lt;br /&gt;b) Creating an OnLoad event from the Programming menu in InfoPath&lt;br /&gt;c) Putting in the following code:&lt;br /&gt;// store an XMLDOM node as a local variable&lt;br /&gt;IXMLDOMNode nodeEmployee = thisXDocument.DOM.selectSingleNode("my:myFields/my:employee");&lt;br /&gt;			&lt;br /&gt;if(nodeEmployee != null)&lt;br /&gt;			{&lt;br /&gt;			if(nodeEmployee.text == "")&lt;br /&gt;			{&lt;br /&gt;	// if the employee name is blank when we load the form, &lt;br /&gt;	// populate the employee node with the current user name&lt;br /&gt;		nodeEmployee.text = System.Environment.UserName;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;I also set up a text field in the Data Source called 'employee' for the username to write to.  &lt;br /&gt;&lt;br /&gt;3. I'm using a web service created in Microsoft Visual Studio (there's a pre-defined project type, C# web project) and connecting one table from a database to this.&lt;br /&gt;&lt;br /&gt;Cheers, Mark.</description></item><item><title>Re: Validating against Share Point login</title><link>https://www.infopathdev.com:443/forums/thread/15627.aspx</link><pubDate>Mon, 22 Aug 2005 19:42:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15627</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15627.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=15627</wfw:commentRss><description>Some questions: Are you using your Main Data Source for the DB connection? How are you populating the field from AD? Is it code or are you using an AD Web service (like the one we provide)?&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: Validating against Share Point login</title><link>https://www.infopathdev.com:443/forums/thread/15626.aspx</link><pubDate>Mon, 22 Aug 2005 09:04:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15626</guid><dc:creator>markperry</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15626.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=15626</wfw:commentRss><description>I've found a load of useful information on the MSDN website &lt;a target="_blank" href=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_2003_ta/html/odc_landinfo03_tr.asp&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_2003_ta/html/odc_landinfo03_tr.asp&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;But there's something that I can't get to work and it's driving me crazy. I've set up a web service to send data to a database. This generates a schema (I think) which sets up the available fields in the Data Source (on the right of the InfoPath designer).&lt;br /&gt;&lt;br /&gt;I can submit my data ok. But when I try to add a field and populate it with the userid from Active Directory, all I get is a blank field. If I do the same thing on a blank InfoPath form, without connecting to a web service, I can populate the field from AD without a hitch.&lt;br /&gt;&lt;br /&gt;It's driving me mad - I'm guessing that the schema I create is stopping me from getting AD info, but I don't know what to do about it. Does anyone have any ideas?</description></item><item><title>Re: Validating against Share Point login</title><link>https://www.infopathdev.com:443/forums/thread/15625.aspx</link><pubDate>Fri, 05 Aug 2005 05:37:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15625</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15625.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=15625</wfw:commentRss><description>That returns the username but you'll still need some way to pull down the user's holiday info which requires authentication.&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: Validating against Share Point login</title><link>https://www.infopathdev.com:443/forums/thread/15624.aspx</link><pubDate>Thu, 04 Aug 2005 15:23:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15624</guid><dc:creator>rbbivens</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15624.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=15624</wfw:commentRss><description>Do you have a form for each user? If so, you can use the System.Environment.UserName to determine the currently logged in user's name.&lt;br /&gt;&lt;br /&gt;I hope this helps.</description></item><item><title>Re: Validating against Share Point login</title><link>https://www.infopathdev.com:443/forums/thread/15623.aspx</link><pubDate>Tue, 19 Jul 2005 18:00:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15623</guid><dc:creator>Agni Jonnalagadda</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15623.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=15623</wfw:commentRss><description>Hi Mark,&lt;br /&gt;You need to write some code to do this. If you are using managed code then you need to get the loggedin user details from the Environment variables, System.Environment.UserName. &lt;br /&gt;Use this userid to filter the details so that data belongs to that particular user.&lt;br /&gt;&lt;br /&gt;One more important thing if you are using script you can try out ADService tool to get the logged in user details.&lt;br /&lt;a target="_blank" href=http://infopathdev.com/webstore/detail.aspx?itemid=18&gt;http://infopathdev.com/webstore/detail.aspx?itemid=18&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Agni&lt;br /&gt;InfoPathDev India</description></item><item><title>Re: Validating against Share Point login</title><link>https://www.infopathdev.com:443/forums/thread/15622.aspx</link><pubDate>Tue, 19 Jul 2005 16:29:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15622</guid><dc:creator>markperry</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15622.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=15622</wfw:commentRss><description>OK, so if I want to follow option a) and authenticate within the form itself, how do I do this?&lt;br /&gt;&lt;br /&gt;Do I need to write some code behind in the scrpit editor or is there an easier way? &lt;br /&gt;&lt;br /&gt;Security is less of a problem because this will initially run on a small office intranet and is not accessed by the outside world.&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Re: Validating against Share Point login</title><link>https://www.infopathdev.com:443/forums/thread/15621.aspx</link><pubDate>Tue, 28 Jun 2005 06:48:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15621</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15621.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=15621</wfw:commentRss><description>Hi Mark and welcome to the forum!&lt;br /&gt;Cool question and definitely this is a common request. You'll need to authenticate the user. You can do this either a) in the form, b) in a web service on top of SQL, or c) in a stored procedure call in your SQL database. It's simpler to do it in a) but it's also not completely secure. Doing authentication in a web service is another way to do this, but requires some kind of mapping to the forms or logic to compare a value to what's in the form. If you are going directly to SQL, you can use Windows Authentication, and have SQL authenticate (compare user to a column in rowset). IF you use a web service on top of SQL, you'll likely have to do some form of impersonation or pass the username in as a parameter, The Recruiting Accelerator (on Microsoft website) does the latter and is a reasonable example of how to do this in general. Please go to msdn and search for it. Microsoft provides all code for the accelerator and this should give you an example of how to use InfoPath, Web service (impersonating) and SQL to authenticate user for forms access. Good luck!&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Validating against Share Point login</title><link>https://www.infopathdev.com:443/forums/thread/15249.aspx</link><pubDate>Fri, 24 Jun 2005 12:44:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15249</guid><dc:creator>markperry</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15249.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=15249</wfw:commentRss><description>I want to build a simple holiday booking system using InfoPath and Share Point. &lt;br /&gt;&lt;br /&gt;How do I make it so that when a user views the form which shows their holiday status, the form validates against their Share Point / AD login and makes it so that they can only see their own holiday and no - one elses?&lt;br /&gt;&lt;br /&gt;All details of holiday are going to be held in an SQL database.</description></item></channel></rss>