Thanks David, that sounds a bit more promising. I'll try to get into the groove tomorrow and see if I can make some of those changes and get a different result. I don't even really care about the friendly username, as from what I was reading in the notes I'd need another table mapping the login names to friendly names.
In the server-side onLogin, it looks like I can use the e.username without needing to bother mapping to a friendly name. How would I go about setting that variable server side and calling it after login client side to assign to a field?
server-side
var myName = e.username
something other than {dialog.Object}.loggedInUserNameFriendlyGet();
Here's the section I was looking at from the release notes:
Friendly User Name
For security reasons, it is not a good idea to expose the logged in user name on the client-side after the user has logged in. In the onLogin server-side event you can execute code to translate the user name that the user logged in with into a 'friendly' user name which can be safely displayed on the client-side.
For example, assume that you had a table that had two columns - 'userName' and 'friendlyUserName'
An example entry in the table might be:
jsmith23 John Smith
In your onLogin server-side event you would execute code to set e.userNameFriendly by looking up the friendly name for the user name.
Once you have set e.userNameFriendly in the server-side event, it can be used in the afterLogin client-side event and also in watch expressions.
TIP: If you do want to have the real logged in user name available on the client-side (for example, so that you can display it in a message like 'Logged in as: [email protected]'), then you can always set the friendly name to the same as the user name in the onLogin server-side event.
For security reasons, it is not a good idea to expose the logged in user name on the client-side after the user has logged in. In the onLogin server-side event you can execute code to translate the user name that the user logged in with into a 'friendly' user name which can be safely displayed on the client-side.
For example, assume that you had a table that had two columns - 'userName' and 'friendlyUserName'
An example entry in the table might be:
jsmith23 John Smith
In your onLogin server-side event you would execute code to set e.userNameFriendly by looking up the friendly name for the user name.
Once you have set e.userNameFriendly in the server-side event, it can be used in the afterLogin client-side event and also in watch expressions.
TIP: If you do want to have the real logged in user name available on the client-side (for example, so that you can display it in a message like 'Logged in as: [email protected]'), then you can always set the friendly name to the same as the user name in the onLogin server-side event.
Leave a comment: