Retrieve the Current User name in sharepoint using webservices
I have designed a infopath
form ,in that form load option I need to retrieve the current USERNAME. Who logged in the site must retrieve using WebServices
only.
So I did that using UserProfileServices.asmx
service and GetProfileByName
Metho开发者_高级运维d.
But I'm getting different USERNAMES ,Sometimes my USERNAME Sometimes form Admin etc.....Please let me know how can I do this....
Please specify what "sometimes" means... And where did you get different Usernames from (WebService or from the InfoPath userName() function)?
If it's the function, this is default behavior if you fill out the form using the client (InfoPath Filler). If it's the WebService make sure you also append the domain to the userName() like this
concat("MyDomain\"; userName())
精彩评论