Select entity records in the list screen that belong to the logged in user
Application Type
Mobile

Hello everyone,

I'm in a screen list that uses an entity named Tasks and I need to see in this screen list, only the records that contain the logged user's name and it has the same content as the entity.

In the entity, the TAREFANOMEUSUARIO field is type TEXT.

How can I do this? I'm new to OUTSYSTEMS and I'm using Portuguese to English translator to communicate with you.

Sorry if there are errors.

Thanks!

Solution
Solution

Here you have if is on tasks screen. As you can see, you are filtering all the data, that as the logged Username with the attribute from the entity tasks, TarefaNomeUsuario.


Let me know is is that, that screen

BellaNapoli.oml

mvp_badge
MVP
Solution

Hello, welcome to the forum,

See below for a way to that using client.Username logged:


The client.Username is mapped when login in the app.

Note: you must ensure that the TAREFANOMEUSUARIO will have a username that will log into the app.

Kind regards.

Não há problema!! Don't be sorry :D It's great that you do effort to try! I try too :D

You need to do, TAREFANOMEUSUARIO = client.Username on the aggregate to see the records of the logged User.

Can you show me the OML again?

Sorry, I saw it wrong your question

Best regards,

Márcio

Once again, thank you MARCIO. I'm learning a lot from you and others.

Remember, I need you to list all records with the USER NAME.

BellaNapoli.oml

Solution

Here you have if is on tasks screen. As you can see, you are filtering all the data, that as the logged Username with the attribute from the entity tasks, TarefaNomeUsuario.


Let me know is is that, that screen

BellaNapoli.oml

Solution

You can see the changes now! Give it a try :)

Thanks my friend. 

I will keep learning from you and others.

No problem!! Keep up the good work!

Regards,

Márcio

Marcio, two more questions on this subject.

For me to count how many tasks this user has, do I need to create an Aggregate?

For me to save the current date and time that the user put in the input of the Initial task by checking or unchecking and the final task as well, do I need to use Aggregate too?

Tips for me to look for?






1- To know how many tasks the user has, you just need to use the property. Try that, I think is that.

2- From what I understood, you need to add that as an attribute to the entity, to save when was created or updated, or finalized.

Is that what you are looking for?

Regards,

Márcio


1. Marcio, I'm happy because I got it and made it work with an expression :) Thanks.

2. In the example I sent you, the fields are boolean and appear in the TASK LIST:

Tarefa Iniciada (Marcar/Desmarcar)

Tarefa Finalizada (Marcar/Desmarcar)

When the user clicks on them, the user can check or uncheck them, so they will be TRUE or FALSE, but when the user checks or unchecks them, I need to save the current date and time that the user is checking or unchecking, do you understand me?

In the example, I don't have the fields to record the dates when the user checks or unchecks, but for any action, I'll save it later on the entity through the save button that already exists in the APP.

Gooooood job!

so to follow all that uncheck and check, you need to know that you are going to need new attributes o your entity.

If you want to save the TarefaIniciada and the TarefaFinalizada you need 2 attributes of type boolean, to be able to use in checkboxes. 

Then, you will also need to have attributes to know when you started or when you finalized, but remember if you want to save the amount of time since you started the task, you will need to save multiple times, for example, you click to start but then after 1h you remember to uncheck again, you will need to "pause" right? then you continue and check again and then you finalize the task. The amount of time to do the task will be determined by the time you start until you pause, and the time you continue until you finalized.


So from this perspective, you will need an extra entity to save the times for the tasks, where it has the attribute id of the task and two date attributes, the start and finalized. And every time you click on the check or uncheck you create another record on the time entity that is a task associated.


I hope that makes sense

Best regards,

Márcio

It did make sense, and I understood your point, I'll try to do as you said... If you can't, I'll ask you for help, thank you.

No problem, I hope you can do it!!! :), to not continue in this thread, next time, create another question and let me know or I will be with attention if you post something!

Happy low coding!

Best Regards,

Márcio

mvp_badge
MVP
Solution

Hello, welcome to the forum,

See below for a way to that using client.Username logged:


The client.Username is mapped when login in the app.

Note: you must ensure that the TAREFANOMEUSUARIO will have a username that will log into the app.

Kind regards.

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