Basic Problem with tables

Basic Problem with tables

  

Hello, i'm starting to learn the use of OutSystems 10. I'm following the PDF tutorial "Relations between tables.. hands on exercise".

I build 2 tables: CONTACTS and CATEGORYS . Both tables are connected via CategoryID

And was able to make all the create, update, delete and show CONTACTS and CATEGORYS forms.

However, when building the show contact form, i can get to see the CategoryID, but can't see the name of the Category, even though on the  PREPARATION Sql query, i'm fetching data from both tables

The strange thing it's that on the EDIT Contact form, with the same query, as i drop on the form the ContactID field, it's automaticly displays an combo with the descriptions of the diferents CATEGORY

Any idea what am i doing wrong????


Images Links

https://postimg.org/image/yar0tgdfh/][img]https://s30.postimg.org/yar0tgdfh/Preparation.png

https://postimg.org/image/t0m225t6l/][img]https://s30.postimg.org/t0m225t6l/Tree.png

Hi Diego,

Your images are too blurry for me to view. Can you share the OML file so someone can take a quick look?

Thanks,

Justin

Justin Babel wrote:

Hi Diego,

Your images are too blurry for me to view. Can you share the OML file so someone can take a quick look?

Thanks,

Justin


Thank you for the Reply Justin.

This is the oml file

Solution

So the issue is, in your preparation you have two queries.

GetContact (SQL), that joins to Category, but you are not using this query, and it is not bound to the ContactShow widget.

The second query, GetContactById (Aggregate), is being using and bound to the ContactShow widget, but this aggregate does not join to Category, so you do not have access to the name.

So you can either change the ContactShow widget to use the GetContact advanced query or you can add the join to the GetContactById aggregate and you will have access to the Category name.

Let me know if this is clear,

Justin

Solution

I've also noticed that on Category_Edit, Category_Show, and Contact_Edit screens preparations, you have this same pattern, an advanced sql statement not being used, followed by an aggregate on the same data.

You can select the queries/aggregates by clicking once on them, and click the F12 key to see where and if they are being used.

Justin Babel wrote:

So the issue is, in your preparation you have two queries.

GetContact (SQL), that joins to Category, but you are not using this query, and it is not bound to the ContactShow widget.

The second query, GetContactById (Aggregate), is being using and bound to the ContactShow widget, but this aggregate does not join to Category, so you do not have access to the name.

So you can either change the ContactShow widget to use the GetContact advanced query or you can add the join to the GetContactById aggregate and you will have access to the Category name.

Let me know if this is clear,

Justin

Thank you very much!!!