How to get infopath functions[like userName(), SharePointServerRootUrl()] value in form_loading in code behind in Infopath 2010 - InfoPath Dev
in

InfoPath Dev

How to get infopath functions[like userName(), SharePointServerRootUrl()] value in form_loading in code behind in Infopath 2010

Last post 02-10-2012 05:45 AM by jaxkookie. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-10-2012 04:05 AM

    How to get infopath functions[like userName(), SharePointServerRootUrl()] value in form_loading in code behind in Infopath 2010

    I have a requirement of getting the infopath functions[like userName(), SharePointServerRootUrl()] value in FormEvents_Loading() in code behind in Infopath 2010. What are the ways we can achieve this.

     I tried writing rules on button click, assign the values to textbox and get the values of the textbox in managed code. This works fine but i need this values in FormEvents_Loading event. so i am calling Click event of button programatically from FormEvents_Loading() but its not fetching the values of this functions, gives blank.

    Filed under: ,
  • 02-10-2012 05:45 AM In reply to

    Re: How to get infopath functions[like userName(), SharePointServerRootUrl()] value in form_loading in code behind in Infopath 2010

    why can't you use the userName() on form load to set field value of user name? You may need to to use a people picker to get it to populate. Are you using this form on multiple servers? I have a form that eventually will be rolled out to multiple servers and locations. I have hyperlinks and images that are local to the client's location. I created a field called URL and set the value to the SP URL, then linked this with concat in all hyperlinks and images. then only one field to update.

    If this is not possible you made need to query the GetUserProfileByName.

    http://pradeep1701.wordpress.com/2010/12/25/infopath-2007-get-user-profile-details-using-sharepoint-user-profile-web-service/

    Kind regards,
    Larry
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.