Movie app assignment 7.3: buy ticket

Movie app assignment 7.3: buy ticket

  

Hello,

I'm working on Movie Mobile App Final Project and I'm stuck on the task where I should create a new ticket. It said: "Clicking an empty seat (green icon) initiates the process of buying a ticket. In the Client Action to handle the On Click Event, you will need to call a Server Action to create and store the new ticket in the database."

Could please someone guide me? I should add  link with a new action? And flow should be like this: start>asiggn>createticket(server action)>mainflow/mytickets. If it's right, not sure what I should assign.

Thank you!

Hi Julia


Sounds like the CreateTicket server action is a database action (It's been a long time since I took the course). If you go to the Database Tab a, expand the table "ticket" You will see actions created bellow. You will see a CreateTicket action there. As for what you need to assign, is defined by what seat the user clicked (Something along the lines of UserId, Seat, etc I a m guessing).


In order to further help you could you post a link to the specific part of the course you are refering to?


Regards,

   CSLJ

Carlos López Santibáñez Jácome wrote:

Hi Julia


Sounds like the CreateTicket server action is a database action (It's been a long time since I took the course). If you go to the Database Tab a, expand the table "ticket" You will see actions created bellow. You will see a CreateTicket action there. As for what you need to assign, is defined by what seat the user clicked (Something along the lines of UserId, Seat, etc I a m guessing).


In order to further help you could you post a link to the specific part of the course you are refering to?


Regards,

   CSLJ

Hi Carlos,


Thank you for your reply :) Here is the link for final task https://www.outsystems.com/learn/lesson/795/movies-assignment/ (assignment 7,part 3). I know about the db CreateAction, but my question is more about the action flow , I mean am I in a right direction or not: 

Thanks!

Solution

You're very much on the right track. To use the CreateTicket action, you need to pass a ticket record.

  1.  Create a local variable of type "Ticket" called "MyTicket"
  2. Assign the appropriate fields to "MyTicket" (Eg MyTicket.UserId = CurrentUserId(), MyTicket.Seat = GetSeats.List.Current.Seat.Id, etc)
  3. Pass the MyTicket local variable to the CreateTicket action
  4. You're done!

Hope this helps!

   CLSJ

Solution

Carlos López Santibáñez Jácome wrote:

You're very much on the right track. To use the CreateTicket action, you need to pass a ticket record.

  1.  Create a local variable of type "Ticket" called "MyTicket"
  2. Assign the appropriate fields to "MyTicket" (Eg MyTicket.UserId = CurrentUserId(), MyTicket.Seat = GetSeats.List.Current.Seat.Id, etc)
  3. Pass the MyTicket local variable to the CreateTicket action
  4. You're done!

Hope this helps!

   CLSJ

Hey Carlos,


Thank you! It helped a lot:)