No records to show - Training Exercise

No records to show - Training Exercise

  

I have just begun the Outsystems training exercise that involves building a movie database. I made it quite a ways when I discovered that I had made some typos. Sometimes I spelled "role" correctly and others I inexplicably spelled some items "roll." 

I managed to "fix" things by renaming the things that I could and duplicating and replacing items that would not allow me to rename them. It seemed like my hack job worked but now I seem to be having trouble getting later parts of the exercise to function properly. 

In the Web UI the issue is exhibited by one of the movie not displaying "producers" when they have been assigned. Other movies allow me to add producers and they will display properly. 

In the attribute editor, I get the "No records to show." alert. This seems to happen when I add the PersonMovieRole attribute to a web screen preparation which leads me to believe that I might have corrupted the data in the PersonMovieRole attribute.

At this point it would be faster for me to start over but I would like to learn how to fix my mistake. I am just not sure where to start.



Hello, Ken.

It seems like you have some Filter rules in you Aggregation. So for your demo to show record results, you need to include Test values that would represent in the filters defined. Check the tab named "Test Values" to see if you have some variables values to fill as a filter test and it will problably show results according to the values written.

Allan Alves wrote:

Hello, Ken.

It seems like you have some Filter rules in you Aggregation. So for your demo to show record results, you need to include Test values that would represent in the filters defined. Check the tab named "Test Values" to see if you have some variables values to fill as a filter test and it will problably show results according to the values written.

I thought that too,  at first,  but the exercise documents indicate that I should see sample results.  I am also having the mentioned issue in the UI for just one movie which makes me think that something is not as it should be. 



Hi Ken,

Can't be sure of what your typo may have caused in terms of having incomplete/inconsistent data on your entities...

A quick "hack" is to select all of your Entities, cut them and then paste them to the same place. You should have a "clean slate", where your entities will be empty and as such your bootstrap logic will run and populate them again with seed data.

Note: This will not magically correct your data, but by doing this you are actually creating new tables to support the new, pasted version of your entities (your old tables will remain on the database, but inaccessible to OutSystems applications). Automatically generated bootstrap logic checks if your entities have no data, and if so populates them with data from the Excel file(s).

What you describe is what I think I did and the data from the excellent files seemed to have followed as it should. Something else,  other data, seems to be causing improper operation. I wish I could provide clearer descriptions but I don't yet understand how it all goes together. I do appreciate your feedback. It makes me feel better about the misspelling fix. 

Ken Hellewell wrote:

I have just begun the Outsystems training exercise that involves building a movie database. I made it quite a ways when I discovered that I had made some typos. Sometimes I spelled "role" correctly and others I inexplicably spelled some items "roll." 

I managed to "fix" things by renaming the things that I could and duplicating and replacing items that would not allow me to rename them. It seemed like my hack job worked but now I seem to be having trouble getting later parts of the exercise to function properly. 

In the Web UI the issue is exhibited by one of the movie not displaying "producers" when they have been assigned. Other movies allow me to add producers and they will display properly. 

In the attribute editor, I get the "No records to show." alert. This seems to happen when I add the PersonMovieRole attribute to a web screen preparation which leads me to believe that I might have corrupted the data in the PersonMovieRole attribute.

At this point it would be faster for me to start over but I would like to learn how to fix my mistake. I am just not sure where to start.




Hi,

Check the joins of the entities you used in the sources.

Hi Ken,

Looking back at your Aggregate sample data, I'd say you forgot to assign any PersonRoleId to the first 10 PersonMovieRole records you created. This also means that your data model is not sound, in your PersonMovieRole Entity, you should've made the PersonRoleId attribute mandatory (the database engine will guarantee mandatory reference attributes when you try to write a record to the database).

The hack I suggested above would have cleared this entirely, and if your code is correct (assigning the right value to PersonRoleId when creating a new PersonMovieRole) you would just have to insert your cast/crew again for your movies (repeating the test portions of your exercises).

That makes sense but I don't completely understand the fix. What exactly do I need to do? 


Thanks so much for the help!

Solution

Ken,

You have two options:

  • Delete the "offending" records from your database, either by bypassing the OutSystems platform and accessing the database directly or by creating a backoffice screen that shows those records and allows you to delete them.
  • "Delete" all contents of the database. You would:
    • On your OSMDb_Core module
      • Cut all entities you have defined;
      • Paste to the same place (it will look like you haven't done anything, but behind the scenes, the pasted Entities will be defining and using new database tables for their data so they will behave as if their contents were deleted - the old tables with the old data are still there, just no longer being used by current entities)
      • Make sure the entities are still Public and not Expose Read-Only
      • Publish
    • On your OSMDb module:
      • Open the Manage Dependencies
      • Filter the Producers by "Show In Use".
      • If OSMDb_Core has errors:
        • Select OSMDb_Core and uncheck everything inside.
        • Press Ok
        • Open the Manage Dependencies again
        • Filter the Producers by "Show All" and search for "OSMDb_Core"
        • Check everything inside
      • Click on Refresh All and then on Ok.
      • Publish
    • At this point, your database should be filled with only the bootstrapped data, which means you will need to add all the records the previous exercises have asked you to add while testing them.
Solution

That is excellent information and very helpful. It may be a bit over my head but I will do my best. 


Thanks!