59
Views
15
Comments
Solved
Pass entity as filter to another aggregate
Question

Hello All,

hope my post finds you healthy!

I appreciate your help in my below case:

I aggregate an entity named "Form" and i display it successfully to user.

The request is to pass through every id of this entity as filter to another aggregate in preparation.(the another aggegate is about another entity. The id is the only common point between the two aggregates.)

Any advise?

mvp_badge
MVP
Rank: #5
Solution

HEllo George,

Let me try to help you

I may be wrong, but it seems that you have a list and want to show, for each item of the list (customer), you want to show a second list (services).

If you have a list, and you want to show, for every item of the list, another list, it will be really hard (if possible at all), to do that using two separate aggregates in the same scope.

The easiest solution is as follow:

In your page with the customer list, you will have ONLY the GetCustomers aggregate, that feed your screen list.
In the list, you will place a BLOCK, and will pass to the block the id of the current item, through an input parameter (YourListName.List.Current.YourEntity.Id).

In your BLOCK, you create another list, and in its preparation (block's preparation), you fetch the services, filtered by the customer id.

That's it.

The problem is that for every customer, you will have an access to the database, to fetch the services. This will impact negatively the performance. But any other solution would involve more complex logic/UI management.

Hope this helps.

Cheers.


Rank: #90

Hi George Mitsiou ,

why you are passing id ,

You can join between them,like below image


https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Data/Handling_Data/Queries/Supported_Join_Types 


You can pass ID in specific case if you need only record based on Form ID.


Regards

Rahul sahu

Rank: #90

Hi George,

You can pass id in filter condition like below image

with same datatype.

can you post your code what you want achive.


Regards

Rahul Sahu


mvp_badge
MVP
Rank: #128

Hi,

If I understand correctly, you just want to get common data from both the entity if yes just follow Rahul steps(First Response).


Thanks


mvp_badge
MVP
Rank: #128
mvp_badge
MVP
Rank: #128

If still you are facing issues, Please share the OML(Module) file will help you.

mvp_badge
MVP
Rank: #5
Solution

HEllo George,

Let me try to help you

I may be wrong, but it seems that you have a list and want to show, for each item of the list (customer), you want to show a second list (services).

If you have a list, and you want to show, for every item of the list, another list, it will be really hard (if possible at all), to do that using two separate aggregates in the same scope.

The easiest solution is as follow:

In your page with the customer list, you will have ONLY the GetCustomers aggregate, that feed your screen list.
In the list, you will place a BLOCK, and will pass to the block the id of the current item, through an input parameter (YourListName.List.Current.YourEntity.Id).

In your BLOCK, you create another list, and in its preparation (block's preparation), you fetch the services, filtered by the customer id.

That's it.

The problem is that for every customer, you will have an access to the database, to fetch the services. This will impact negatively the performance. But any other solution would involve more complex logic/UI management.

Hope this helps.

Cheers.


mvp_badge
MVP
Rank: #5

Hello George.

Did you went the online training? :)
If not, I recommend, as it is a very good way to learn about the platform.

A Block is a piece of reusable interface.
If you are working on a Traditional Web Application, it is called Web Block. Reactive and Mobile applications they are called only Block.

All the online training have videos explaining them, how to use, etc :) 


mvp_badge
MVP
Rank: #5