Set Logged in User's Parameters in WebForms

Requirements:

To create a custom Web Form which provides user information who is logged in that session

 

Solution:

In this, we will fetch the user information from the AU_USERS table of Backend database. We will fetch UserName, Role of the user and User ID from the database. We can achieve this requirement by creating a Web form (RichForm) and using following details:-

1. UserName like admin etc. which you can fetch using below script:-
var username=window.parent.parent.username;
document.getElementsByName('UserName')[0].value=username;

2. Role - The user can be Sysadmin, Developer, Business User etc. We can fetch as:-
document.getElementsByName('Role')[0].value=window.parent.parent.userTypeFlag;

3. User ID- Unique ID with which the user is stored in the AU_Users table of the database.
document.getElementsByName('UserID')[0].value=window.parent.parent.loggedInUserId;

We need to write all these codes in the <script> tag. Refer the screenshot and attached zip file which contains web forms for the user information.


UserInformation.png

Have more questions? Submit a request

0 Comments

Article is closed for comments.