Current User (Without Code) WSS 3 - InfoPath Dev
in

InfoPath Dev

Current User (Without Code) WSS 3

Last post 11-03-2010 06:32 AM by Sailor. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 10-29-2010 08:55 AM

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Current User (Without Code) WSS 3

    Hello,

     I have been searching to find a way to get information of the current user.  I can't used code due to the lack of code signing ability in our environment, and can't use the webservice as we are only using WSS 3.  Are there any other ways to get this information?

    Thanks!

  • 10-29-2010 10:28 AM In reply to

    Re: Current User (Without Code) WSS 3

    Hi Sailor, if you're on a domain, you can use the windows login with: userName()

    You can set it as the default value of a field, click on "fx" and then add the formula.

  • 11-02-2010 06:03 AM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Current User (Without Code) WSS 3

     Thank you.  Unfortunately this will only return the username and I need (ideally) First, Last, Phone information.  Did even more searching and it seems this is just not something that is possible.  If anyone can suggest an alternative I would be very happy!

  • 11-02-2010 06:30 AM In reply to

    Re: Current User (Without Code) WSS 3

  • 11-02-2010 06:39 AM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Current User (Without Code) WSS 3

     No, that doesn't work in WSS 3.0.  You have to have MOSS I believe.  Thanks for your help though!

  • 11-02-2010 07:05 AM In reply to

    Re: Current User (Without Code) WSS 3

    Hi, you right UserProfileService.asmx use SSP and it's just available with MOSS, I don't think you can do that with the native function of InfoPath and WSS.

  • 11-02-2010 07:12 AM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Current User (Without Code) WSS 3

    I just found out our company host a webservice that is suppose to allow user lookups.  It's not structured the same way as the userprofileservice.asmx.  Anyone know if I can get this to return the same kind of information?  This is really outside my abilities.  I've attached the sample code. 

  • 11-02-2010 08:13 AM In reply to

    Re: Current User (Without Code) WSS 3

    Hi, the name displayed on "created by" or "modified by" column when you created an item on WSS correspond that what you need ? I ask that because you can use a method to get this information whitout codes and with WSS.

  • 11-02-2010 08:20 AM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Current User (Without Code) WSS 3

     Yes, I think this would be better than nothing.

  • 11-02-2010 08:49 AM In reply to

    Re: Current User (Without Code) WSS 3

    Ok, this is not really elegant, you can create a list and display the last created item first, then you add a new data connection that create an item to this list ie:http://www.infopathdev.com/blogs/matt/archive/2006/02/02/Add-SharePoint-List-Items-with-InfoPath.aspx

    after that, you create a new data connection to this list to get the username of the creator. On form option, on form behavior, you run first, your data connection that create you item and secondly the one who get the information. Finally on a field of your main datasource, you set as default value the column "created by " of your new list.

    Hope it's clear

  • 11-02-2010 10:38 AM In reply to

    Re: Current User (Without Code) WSS 3

    I've been using this method for sometime (on forms that aren't trusted) and it works ok. It's better if you then delete the created entry to keep the list 'clean'. The method however isn't fool proof and if there is a lot of simultaneous form users you can get the wrong entry i.e. created by is incorrect. Additionally, you can get an entry left on the list if you're not careful. I guess you could add some more checks by writing the time to the list (from a code variable) then filter the read back to choose the line item with the time you wrote. good luck.
    Filed under:
  • 11-02-2010 12:09 PM In reply to

    Re: Current User (Without Code) WSS 3

    As to your web service, try adding a query connection to it in your form. The query parameter (match) looks like it accepts a string, and from the name of the web method (GetEmployeesByNameOrId), I'd think you could enter either a name or an alias (guessing as to what Id is).

    So, add a query connection, put in your alias for the match parameter, and see if you get any data back. In fact, when I'm trying to figure out a new web service, I usually drag the whole data source onto my form and add a button that will run a query using the data source. Then I can experiment a bit, get a sense for what data is returned.

    Hilary Stoupa

  • 11-02-2010 02:16 PM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Current User (Without Code) WSS 3

    Hello,

    Thank you.  I tried doing a query of this webservice (following the instructions on this blog) http://blogs.msdn.com/b/jannemattila/archive/2007/01/21/infopath-and-web-service-data-connection.aspx but I never return any values.  I checked around and was told this web service does indeed work well, as programmers are using it for other web-based resources.  I must be doing something wrong...though this does seem very simple. 

    Create the receive connection
    Create some text box controls (one for the query item) and the rest to display the data
    Add button with rule to set the data connection "query" field, rule to submit the query, then rules to set each of the fields with data from the query.

  • 11-02-2010 03:40 PM In reply to

    Re: Current User (Without Code) WSS 3

    Have you tried adding fields to your form that are bound to the receive connection so that you can see whether the connection returns values? Can others who are using the web service tell you a value known to work for the match parameter that you can try?

    Hilary Stoupa

  • 11-03-2010 06:32 AM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Current User (Without Code) WSS 3

    This is interesting.  Maybe I'm not understanding something.  When I put the query field (LanId) on the form and preview it, it automatically puts my LanId in that field.  But with all the data fields on the form they are never populated.

Page 1 of 1 (15 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.