The value of rating is saving as 0 in table attribute

The value of rating is saving as 0 in table attribute

  

Hi,

I am newbie in outsystems, i have developed MovieDB web application by following excercise,The Issue is when i rate the movie, the value of rating is stored as "0" in database rating attribute.

I could not get how this is happening and how to solve this..

please anyone there to answer this..?

Thanks in advance

Hello Usama.

The "saving" of the rate (stars) is done in part 3, section 2:

2. Create the logic to create or update the user rating, and refresh only the parts of the Web Screen related to movie ratings.
a) Open the OnRatingNotify Screen Action in the MovieDetail Screen.
b) Add a Refresh Data statement to the Action flow, and set the Data Source to ‘GetUserMovieRating’, to re-execute the query and return the rating to be updated, it it exists.
c) Next, add an Assign statement and set the following assignments to define the rating to the movie, given by the user currently logged in.  
GetUserMovieRating.List.Current.UserMovieRating.UserId = GetUserId()
GetUserMovieRating.List.Current.UserMovieRating.MovieId = MovieId
GetUserMovieRating.List.Current.UserMovieRating.Rating = TextToInteger(NotifyGetMessage())
NOTE: The NotifyGetMessage() Action returns the message sent by the Notify Action, used before in the StarDisplay Web Block. The message is of type Text, and as we used it to inform the parent of the rating star clicked, we need convert the message back to Integer.
The first two assignments are necessary, when creating a new rating. When updating, the user and movie are already known
d) After the Assign statement, add the CreateOrUpdateUserMovieRating Entity Action. Set the Source property to ‘GetUserMovieRating.List.Current’, to create or update the rating in the database.

Which part you skipped ;)
Could you share your OML so we can take a look? :)

Cheers,
Eduardo Jauch