- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 08:07 PM
I want get the current user name and user id ,display in the preview
plase help me
thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 03:14 PM
Hi zhian,
If you look at the screenshot that I posted earlier the fields that are references have two correlating properties. One property displays the sys_id of the referenced record and the other one displays the display value of the record. It's indicated by the suffix of "_dv" at the end of the property name.
So to show the display value of the department it would be user.department_dv instead of user.department.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 08:28 PM
Hello
HTML:
<label for="name">User Name:</label>
<input type="text" id="name" name="name" ng-model="data.username"><br><br>
<label for="userid">User ID:</label>
<input type="text" id="userid" name="userid" ng-model="data.userid"><br><br>
SERVER SCRIPT :
data.username = gs.getUser().name;
data.userid = gs.getUser().user_name;
No need of client controller
try this and let me know
mark my answer correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 08:52 PM
I want to display the currently logged in username and id
No create table and input user info
It's not easy to understand, sorry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 09:24 PM
HTML:
<h6> User name:</h6>
{{data.username}}
<h6> User ID:</h6>
{{data.userid}}
Server script :
data.username = gs.getUser().name;
data.userid = gs.getUser().user_name;
gs.getUser().name --> this method gives name
gs.getUser().user_name -- > this method gives ID
if you want to access any field on the user table. you can use gs.getUser() and just append ".your_field_name" .
Hope this helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 09:26 PM
Displays the ID and NAME of the currently logged in user