25
Views
5
Comments
Solved
Register values in the database

Hi,


I don't understand what's going on.

I created an entity to record exchanges between two users.

When I try to register who sends and who receives only registers who receives, both in the sending and receiving attribute. (I dragged the entities to create the screens)




My 2 entities:

Thanks


Rank: #94
Solution

Hello SpiritFox,

Thank you for sharing your OML.

Your problem is related to GetTrocas Aggregate in Trocas screen.

As you can see in the table, both expressions for columns USERID ENVIA and USERID RECEBE have the same expression:

GetTrocas.List.Current.User.Name


Checking on your Aggregate, you are joining Trocas entity with User entity only for USERID_RECEBE attribute:

This means that you will only get the information (User entity) for USERID_RECEBE.


In this scenario, you need to join twice with the User entity. One join for USERID_RECEBE and the other join for USERID_ENVIA, resulting in this Aggregate:


As you can see, now you are getting this information (User entity) twice for both USERID_RECEBE and USERID_ENVIA.


Back to your screen, you just need to adapt your expressions. One of the columns will be:

GetTrocas.List.Current.User_Recebe.Name

And the other will be:

GetTrocas.List.Current.User_Envia.Name


Please refer to attached OML file with these changes :)


Hope that this helps you!


Kind regards,

Rui Barradas

Trocas.oml

Rank: #94

Hello SpiritFox,

Hope you're doing well.

Can you please share your OML with us so we can take a look into it?


Most likely you are not saving the correct UserId in USERID_ENVIA attribute or the expression in the screen is not correct and both the columns are pointing to USERID_RECEBE attribute.


Kind regards,

Rui Barradas

Rank: #286

Hi SpiritFox,

I think the USERID_ENVIA  is not getting stored in your Trocas entity correctly according to the selected User. 

Please make sure that correct selected UserId is getting stored in DB for USERID_ENVIA attribute by debugging your Save action flow, else you can share your OML for us to know what is exactly going wrong in your implementation.

Hope it helps, Thanks :)

mvp_badge
MVP
Rank: #51

Hi SpiritFox, 

The simplest option is to debug the Save action and see what is being set in the attribute before you pass the record to CreateOrUpdate entity action .


Regards,

-PJ-

Rank: #2332

Hi,

Sharing my file 


Thank you 

Trocas.oml

Rank: #94
Solution

Hello SpiritFox,

Thank you for sharing your OML.

Your problem is related to GetTrocas Aggregate in Trocas screen.

As you can see in the table, both expressions for columns USERID ENVIA and USERID RECEBE have the same expression:

GetTrocas.List.Current.User.Name


Checking on your Aggregate, you are joining Trocas entity with User entity only for USERID_RECEBE attribute:

This means that you will only get the information (User entity) for USERID_RECEBE.


In this scenario, you need to join twice with the User entity. One join for USERID_RECEBE and the other join for USERID_ENVIA, resulting in this Aggregate:


As you can see, now you are getting this information (User entity) twice for both USERID_RECEBE and USERID_ENVIA.


Back to your screen, you just need to adapt your expressions. One of the columns will be:

GetTrocas.List.Current.User_Recebe.Name

And the other will be:

GetTrocas.List.Current.User_Envia.Name


Please refer to attached OML file with these changes :)


Hope that this helps you!


Kind regards,

Rui Barradas

Trocas.oml