28
Views
12
Comments
Solved
fetching static entity in dropdown
Question
Application Type
Reactive

can we fetch a static entity in dropdown if so how? im fetching the entity through aggregate and the dropdown not showing the records

Solution

Thanks for sharing it.


You should load the list of selectable genders in another aggregate. So basically you will have your list aggregate which retrieves every gender, and then the EmployeeProfile aggregate will only load the selected gender for this EmployeeProfile.


In your previous one, you were loading the selected Gender, but you were not loading the whole list of genders from the static entity.


Please try the OML below.

HR Portal.oml

Hey Muhammad,

Are you able to share your OML? This can have many reasons behind it, it would be more assertive to have more information such as screenshots or the OML.

here's my oml in add employee screen i add a dropdown of gender which is a static entity ,

HR Portal.oml
Solution

Thanks for sharing it.


You should load the list of selectable genders in another aggregate. So basically you will have your list aggregate which retrieves every gender, and then the EmployeeProfile aggregate will only load the selected gender for this EmployeeProfile.


In your previous one, you were loading the selected Gender, but you were not loading the whole list of genders from the static entity.


Please try the OML below.

HR Portal.oml

yup its working but can you check why its not saving it into database it gives an error of foreign key constraint.

You were assigning a variable, but you never assigned the right data to it. So the GenderId is not filled int.

This is the variable that holds the selected gender:

But this is what you are passing into your create action:


So you have two choices, you either need to send the aggregate data directly to the create employee, or make sure the variables below are filled in with the right information:


I'd recommend you to use directly the aggregate and not use the variables, unless it's needed.


So your inputs should use this variables instead:


In this way, you can send the most updated data to your create action, without the need to keep variables and aggregates in sync.


Hi Muhammad Haseeb, 

what i understand from question

Yes, You can Fetch the static entity in dropdown



Thanks 

Hardik Khare

Dropdown.oml

Hi Muhammad,

PFA oml file for your reference

Hope this helps

DD.oml
Champion

Hi,

If you are not getting values in dropdown. Then you should check below 3 points :

1. In aggregate you are getting records or not. Also for aggregate property you need to check it get load on start.

2. You assigned above aggregate list as data source of dropdown.

3. In dropdown you are selecting right attribute for drop down value.

regards

Hi @Muhammad Haseeb,

To bind the dropdown with any entity in you application ! you should take care about this four properties of dropdown .

1. Variable : which store your current selected value means that you should create a variable to bind it. Read More



Regards

Hi Muhammad,

We need more information to help you. Is the static entity in a library module?
If it is you cannot use it in aggregates.

See the link below for more information: https://success.outsystems.com/documentation/11/developing_an_application/reuse_and_refactor/libraries/ 

Regards,

Rúben

Hii

    You can use dropdown on click property refresh the aggregate then resolve this issue

hi,

if it is a simple dropdown to select the gender then why are you calling it with EmployeeProfile table in the aggregate. just call the static gender static entity in aggregate and you will get the data.

attached the oml for reference.


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