Quantcast
Channel: Forum CRM Development
Viewing all articles
Browse latest Browse all 1000

Access User Entity Attributes through JavaScript

$
0
0

How can I access the user's primary email field via JavaScript?  The following code sample works fine to get the user's full name, but I cannot figure out how to access other fields on the user entity.

Consider the .FullName field on the user entity.  If you look up the name, the name is fullname.  If you used that in the JQuery call, it would fail.  You also cannot use the display name because it has a space in it.  So how do you look up the name of the other fields?

There is a field named "Primary Email Address" with a name of "internalemailaddress".  I tried both and neither work.  So how do we look these up?  If it is not the display name, not the actual name, then how do we know what name to use?  I cannot even find a list on MSDN but I suspect it is there somewhere.

Any suggestions, links, etc. are much appreciated. 

function RetrieveUser(id) {
 SDK.JQuery.retrieveRecord(
     id,"SystemUser",
     null, null,
     function (systemuser) {
         alert("Retrieved the user \"" + systemuser.FullName+ "\". This account was created on : \"" + systemuser.CreatedOn + "\".");
         alert(systemuser.InternalEmailAddress);
     },
     errorHandler
   );
}


Jon Gregory Rothlander


Viewing all articles
Browse latest Browse all 1000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>