26
Views
10
Comments
Solved
Issue with one attribute of an entity

Hi all,

So, I have developed a small employees management app. I have manually populated the employee entity (which has as attributes an ID, a Name, a LocationID and a ManagerID - for locations I have a different entity called 'Location' with an ID and a Name) as you can see in the capture below.

But when I run the application in browser, the employees list is displayed in a different way comparing with the way I implemented in Outsystems Service Studio. As you can see, it's a problem with the 'Manager' column as each employee has his own name allocated as a manager.

Also, when I'm trying to add a new employee in this list, by clicking the 'Add Employee +' button, I'm redirected to an employees details page, where I can't allocate a manager for the new employee. As you can see in the capture below, the 'Manager' drop-down' is empty.

Do you have any idea what could cause this issue?

Thank you!

2022-12-30 07-28-09
Navneet Garg
Solution

As you can see both have same assignment you need to get name by ManagerID (

GetEmployeesByName.List.Current.Employee.ManagerID)

As your both data in same table you need to use self join to get the manager name

For dropdown you should use At start

2026-02-26 06-29-24
Rahul
 
MVP
Solution

Set this property as Start.

Only on demand will work when you force refresh this aggregate.

UserImage.jpg
Valentin Tamas

Yes, thanks a lot @Rahul Sahu !


2022-12-30 07-28-09
Navneet Garg

Can you please share oml file. It must be wrong assignment.

UserImage.jpg
Valentin Tamas

Sure! 

EmployeesManagementApp.oml
2022-12-30 07-28-09
Navneet Garg
Solution

As you can see both have same assignment you need to get name by ManagerID (

GetEmployeesByName.List.Current.Employee.ManagerID)

As your both data in same table you need to use self join to get the manager name

For dropdown you should use At start

UserImage.jpg
Valentin Tamas

Awesome, thanks for your help @Navneet Garg. Just one more question. As it's my first OutSytems app, I'm not so familiar with the use of self join. What should I do for displaying the manager name, too? 


2022-12-30 07-28-09
Navneet Garg
2026-02-26 06-29-24
Rahul
 
MVP

Can you provide the more detail on Screen of Add Employee page.

What aggregate you are using for Manager Drop down.
Just check it should be separate Aggregate for Manager Dropdown on screen which bind with Employee ID and Name.

2026-02-26 06-29-24
Rahul
 
MVP
Solution

Set this property as Start.

Only on demand will work when you force refresh this aggregate.

UserImage.jpg
Valentin Tamas

Yes, thanks a lot @Rahul Sahu !


2022-12-30 07-28-09
Navneet Garg
EmployeesManagementAppUpdated.oml
2023-03-13 10-26-05
Sriyamini

Hi @Valentin Tamas ,

I assume that you are getting the employees list from aggregate with sources employee table joined with another employee table where the join is based on first employee table's manager ID = Second Employee Table's ID. then check whether you are using second employee table's name column for manager column in the screen.

On the details page, check whether you are passing a list for the manager dropdown from the aggregate with source as employee table and should have a filter implying manager id = NULLIDENTIFIER() to get the managers. 

It would be great if you share your OML to check.

Thanks, 

Sriyamini J



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