130
Views
8
Comments
Solved
Login\User.Name on combo box by default
Question

Hi Guys!


Well, i am trying to implement something like, when i login with a user(i am using the entity Users from outsystems) he will show up on the combo box like a default value.


Table

https://tinypic.com/view.php?pic=np5sb5&s=9#.WPiLa9LyuUk

ComboBox

https://tinypic.com/view.php?pic=w2lpus&s=9#.WPiLh9LyuUk

Aggregate

https://tinypic.com/view.php?pic=ndv1ux&s=9#.WPiLptLyuUk


Just can reach that point. I am missing something.


Any help will be usefull

Tks, Cheers!

2023-12-07 07-51-40
Remco Dekkinga
 
MVP
Solution

Hi Gatts,

The second filter of the aggregate that is used as source for the table is not correct:

Hope this helps.

Kind regards,

Remco Dekkinga

2023-12-07 07-51-40
Remco Dekkinga
 
MVP

Hi Gatts,

In the Combobox you are using a variable. You have to assign the UserId of the current logged in user to this variable. In P10 you can use the "GetUserId()" action to get the UserId and in older versions you can use "session.UserId".

UserImage.jpg
Gatts

Hello!

So i need to put the GetUser() in the aggregate that i showed before, right?

But i dont understand how i suppose to do the variable of the combo box, i keep trying to experiment alternatives, but i am stuck at this.


I am sry for the trouble.

2023-12-07 07-51-40
Remco Dekkinga
 
MVP

Hi Gatts,

Not in the aggregate, but in an Assign in the Preparation of the screen.

1. In the Preparation: You have the aggregate that fetches all the data.

2. In the preparation: You assign the default user (GetUserId()) to the variable that you also use in the combo.

3. In the combo, assign the aggregate and the variable

Hope this helps you!

Kind regards,

Remco Dekkinga


UserImage.jpg
Gatts

Tks for the help!

It really work, but now the problem is that i cannot change to another user in the combo box. I am trap to that userId.

https://tinypic.com/view.php?pic=5y9hrr&s=9#.WQBw69IrKUk

Maybe is not that difficult, but for some reason i am getting lost in the matter.

Tableee.jpg
2023-12-07 07-51-40
Remco Dekkinga
 
MVP

Hi Gatts,

Can you show the contents of your aggregate?

It seems that you filtered on the current user id in the aggregate, so you can now only select your own account in the combo. And it seems that the query of the results shown in the table is having a filter on the userId. Can you change this to (UserId = @UserId OR @UserId = NullIdentifier())

With the second part, you will skip the filter when no UserId is selected.

Kind regards,

Remco Dekkinga

UserImage.jpg
Gatts

I will keep following your tips. There is my preparation and some filters.

I will share my oml in the case that you have some time to see what is going on.

Tks for all the help!

Preparation

https://tinypic.com/view.php?pic=10z3iix&s=9#.WQDDa9IrJhE

GetUsers

https://tinypic.com/view.php?pic=iyhlxg&s=9#.WQDC5NIrJhE

NovasAssistenciasTableAgregate

https://tinypic.com/view.php?pic=33tm9ad&s=9#.WQDDP9IrJhE


Cheers

PAT_Ecobite26-4.oml
2023-12-07 07-51-40
Remco Dekkinga
 
MVP
Solution

Hi Gatts,

The second filter of the aggregate that is used as source for the table is not correct:

Hope this helps.

Kind regards,

Remco Dekkinga

UserImage.jpg
Gatts

Tks for the help, it really worked.

Now i can change the person in the combo box and it changes the values of the table too.


Tks a lot or your patience!


Cheers

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