0

I am a new user to Sharepoint. I have created a link to another app.

Example: https://www.abc.com/OrderTrackingSystem/Production/Orders_list2.asp

At the end of this Link I would like to pass a paramter. The parameter would be the user logged into sharpoint.

Example: https://www.abc.com/OrderTrackingSystem/Production/lOrders_list2.asp?s_name=blahblah

Can someone help. In my application programs this user can be called by using a built in function like request.variable.logonuser. But I am actually writing code to be able to do this. Where do I even start in sharepoint. I would assume I would assign it to some type of variable and then place that at the end of the link. But where would this occur. Any step by step help or direction would be appreciated?

  • what are the tools at your disposal? SharePoint Designer? Javascript? also, is it 2013 or 2010 ? – MdMazzotti Jan 29 '14 at 16:39
  • SharePoint designer, 2010. – Andrew Coleman Jan 29 '14 at 19:54
  • 3
    Be aware that there will be no security implicit to this approach. The user could potentially hand edit the URLs to send any username they would like. This may or may not be an issue in your case, I just wanted to point that out. – tyshock Jan 29 '14 at 21:54
1

You can also use the javascript CSOM to get the current user

function getCurrentUser() {
      var clientContext = SP.ClientContext.get_current();
      var web = clientContext.get_web();

          user = web.get_currentUser();
          context.load(user);
          context.executeQueryAsync(onGetUserNameSucces, onGetUserNameFail);
}
function onGetUserNameSucces() {
// TODO: implement your own succes handler
}
function onGetUserNameFail(sender, args) {
// TODO: implement your own fail handler and do some logging
}
0

Take a look at SPServices. This offers the ability to get the current logged in user and I have used it in the past to do exactly what you are looking for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.