Help provide a guide on user identification
Application Type
Traditional Web

Hello, i have developed an application and presently want to implement user identification. I want the application to keep records of user who inputted a particular sales data in the format presented in the table below:


Sales Table

SN        Item Sold   Amount    User

1.           Prado           4.6m       Sam

2.          Corolla          1.9m       Mary

3.          Mazda            1.5m      Sam


No 1 on the above sales table was inputted by a user named  Sam, 

No. 2 was inputted by a user named  Mary. 

No 3. was inputted by  a user named Sam


I want a situation where i will be able to know the user who inputted a particular sales data.


My question

Please guide me on how the application can keep record of the user that inputted a particular sales data.

Thanks in advance

mvp_badge
MVP
Solution

Hi Harrison,

I am not sure if you have checked the OML I uploaded or not. There is no dropdown in the form. User id is recorded on the save screen action.

Even if you have field in the form just remove it from the screen and assign value to the userid attribute using GetUserid() in the save screen action. So that is will be recorded by the system not from user input. 

Hi @Harrison 

What you want is an audit filed.

First, from my understanding Sam and Mary will be users from the app, so to the Sales entity, you need to add an extra filed (CreatedBy) that will store the logged user.

Then only the save action will set the id of the logged user to be saved.



On the sales list page, on the aggregate, you need to join the user entity in order to get the name of the user according to the CreatedBy value stored.




Regards

Gonçalo Almeida

mvp_badge
MVP
Solution

Hi Harrison,

Please find attached a sample with example of managing records for the users as you are are looking for.

I woul also suggest you to please complete the below guided path to learn this kind of basic details so that you can implement it faster without any need of help from other.

https://www.outsystems.com/training/paths/2/becoming-a-traditional-web-developer/

SalesDemo.oml

Hello Nikhil , thanks for the guide. Your effort is highly appreciated.

It appear like a dropdown list on the detail page for the user to select.

I wanted a situation where the application will independently keep the record. 

So that i will put a column on the sales list page that will display the specific user that recorded. 

Thanks

mvp_badge
MVP
Solution

Hi Harrison,

I am not sure if you have checked the OML I uploaded or not. There is no dropdown in the form. User id is recorded on the save screen action.

Even if you have field in the form just remove it from the screen and assign value to the userid attribute using GetUserid() in the save screen action. So that is will be recorded by the system not from user input. 

Champion

Hi Harrison,

You can add an attribute to the Sales Entity to store the user ID that created this record.

Kind regards,


Hello Tom, thanks for the guide. I deeply appreciate the effort. 

Your suggestion is in the right direction but the application is not recording the user on its own.

It appear like a dropdown list on the detail page for the user to select.

I wanted a situation where the application will independently keep the record. 

And so that i will put a column on the sales list page that will display the specific user that recorded the sales.

Please, guide me

mvp_badge
MVP
Solution

Hi Harrison,

Please find attached a sample with example of managing records for the users as you are are looking for.

I woul also suggest you to please complete the below guided path to learn this kind of basic details so that you can implement it faster without any need of help from other.

https://www.outsystems.com/training/paths/2/becoming-a-traditional-web-developer/

SalesDemo.oml

Hello Nikhil , thanks for the guide. Your effort is highly appreciated.

It appear like a dropdown list on the detail page for the user to select.

I wanted a situation where the application will independently keep the record. 

So that i will put a column on the sales list page that will display the specific user that recorded. 

Thanks

mvp_badge
MVP
Solution

Hi Harrison,

I am not sure if you have checked the OML I uploaded or not. There is no dropdown in the form. User id is recorded on the save screen action.

Even if you have field in the form just remove it from the screen and assign value to the userid attribute using GetUserid() in the save screen action. So that is will be recorded by the system not from user input. 

mvp_badge
MVP

Hi Harrison,

On your second reply you state something different you want then on your original post. Then your third reply just repeats your second reply. Apparently it was not clear what you meant in the second reply, just repeating it doesn't make it more understandable for the reader.

Try to clearly define what you want, so people can help you correctly. Why not have a that detail you want in the first place?

Regards,

Daniel

Thanks for the advice

Hi @Harrison 

What you want is an audit filed.

First, from my understanding Sam and Mary will be users from the app, so to the Sales entity, you need to add an extra filed (CreatedBy) that will store the logged user.

Then only the save action will set the id of the logged user to be saved.



On the sales list page, on the aggregate, you need to join the user entity in order to get the name of the user according to the CreatedBy value stored.




Regards

Gonçalo Almeida

I love to say a big thanks to everyone that contributed to the solution. Your insights are deeply appreciated. A big thanks to Tom and Goncalo. I love to specially thank Nikhil. I got the full understanding and solution by adopting the oml file and guide Nikhil provided. You are all appreciated. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.