If or on change action?

If or on change action?

  
I'm not sure how to proceed. The setup: instructor is chosen from a drop down box, the next box returns all the available meeting times (checks for the instructor, office hours, available (boolean set to True), then the student chooses his name & saves. Once the student chooses the time (in the 2nd box), I want the available field set to False to remove that time from the available times. I am not sure whether I need to use an IF or on change or something else. What do advise? Thanks!
Hi,
If I understand the scenario right, you want to have an entity something like

InstructorSchedule
    Id - Integer (autonumber)
    InstructorId - Instructor Identifier
    Booked - Boolean
    Hour - Integer

You then select from this table WHERE InstructorId = <the instructor chosen on the 1st combo> AND not Booked.

After someone books a meeting, on the Save action, you will want to UPDATE the appropriate row of your InstructorSchedule table with Booked = True

Hope this helps,


Miguel
Thank you.  I was wondering if I could place the update on the save action. 
I am having trouble with the update on the save action.  I've tried several days now and just can't seem to get it to work out. I've opened up the save action, but I can't figure out where and how I should put the update.  I've included a screenshot of my save action.  Can you point me in the right direction? Many thanks! 
Hi Tonya,

It seems to me that you'd want to insert the following nodes between CreateOrUpdateAppointment and the Feedback_Message:

1) GetInstructorScheduleForUpdate - pass in the InstructorSchedule id that was selected on the dropdown where the user just picked the hour appointment hour;
2) Assign node - add the following assign: Variable 1 -
GetInstructorScheduleForUpdate.Record.InstructorSchedule.Booked, Value 1 - True
3)
UpdateInstructorSchedule - pass in GetInstructorScheduleForUpdate.Record

This should do it.

Cheers,

Miguel
Hi Miguel,
I am still having a problem.  I think I understand what you are telling me.  1.  Create a query named GetInstructorScheduleforUpdate and pass in the ID.  2.  Create an assign and put in GetInstructorScheduleForUpdate.Record.InstructorSchedule.Booked, Value 1 - True.  3.  Create an action called UpdateInstructorSchedule and add in GetInstructorScheduleForUpdate.Record.  My actual setup is a little different than the one you propossed and I think I am having a hard time mapping to two together.  My "booked" entity is actually on another table and is called "available".  It is always set to true.  I want to change it to false when an appointment is made.  Here's an entity diagram:  
Thanks!  Tonya
Hi,

You just need a small variation on what I said.

Somewhere in the Preparation you must have queried for all the available OfficeHours for this Instructor. You will have used this query to fill in the Combo Box.

On submit, you will have the selected OfficeHours Id in the variable associated with the Combo Box.

Then add the 3 nodes

1) GetOfficeHoursForUpdate - pass in the OfficeHours id that was selected on the dropdown where the user just picked the appointment hour;
2) Assign node - add the following assign: Variable 1 -
Get
OfficeHoursForUpdate.Record.OfficeHours.Available, Value 1 - False
3)
Update
OfficeHours - pass in GetOfficeHoursForUpdate.Record

Cheers,


Miguel
Oh Miguel, I hate to admit it, but I am still so lost.  The variable listed in the combo box is AppointmentEdit.Record.Appointment.StartTime.  I should take that variable and pass it in, but to what?  Do I do an action, a query? I've tried both.  I can write a query that lists all the appointments by ID, but I can't figure out how to specify that I want it to use the one listed in the dropdown box.  When I go to create the assign node, I don't see a GetOfficeHoursForUpdate.Record.OfficeHours.Available.  I see GetOfficeHoursForUpdate.List.Current.OfficeHours.Available.  (I've mastered setting the value to False :) ).  I know I'm missing something obvious, but this is my first project.  Thanks for your patience!  Tonya
Yes!  I finally got it to work!  Thanks, again! 
Tonya Stephens wrote:
Yes!  I finally got it to work!  Thanks, again! 
 
 Glad you managed to get it to work! Good stuff. ;-)

Cheers,

Miguel