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.