NetTalk Central

Author Topic: Exiting an update form without saving the record  (Read 3692 times)

frankacosta

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Email
Exiting an update form without saving the record
« on: July 17, 2017, 06:30:26 PM »
Hi,
I have an appointment program.  A user can click on book an appt, and he will be brought to the update form.  From there there is a lookup button for available times.  Now this is a group session and 5 people can book into the time slot.  This is working great.  but if it is full I want to be able to put the client directly onto a waiting list for that time slot (which i can do upon return from the lookup form).  I know if the time slot is available or not, but if I select it, and click confirm it will add a 6th person to the group.  What are your thoughts on how I can skip saving the schedule record when I click confirm the booking (or just skip pressing the confirm button and exiting the form without the user doing anything) – hope this is clear.
thanks
frank

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Exiting an update form without saving the record
« Reply #1 on: July 17, 2017, 09:14:14 PM »
Hi Frank,

You can change the Action of the form in the ValidateRecord embed.
In other words, let's assume the action is set to 1 (InsertRecord). The user clicks on save.

The code runs through ValidateRecord. Typically this can mark the record as "invalid" in which case the form stays open so the user can fix the problem.

But it can also change the action at this point.

After this completes the flow then goes back to the class, which re-checks the action, and then applies the appropriate file activity. By setting the action to Net:NoAction you effectivly "do nothing" - the form just closes.

so in ValidateRecord you can just have

ans = Net:NoAction

Cheers
Bruce

frankacosta

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Email
Re: Exiting an update form without saving the record
« Reply #2 on: July 18, 2017, 02:21:23 PM »
Thanks Bruce, that worked great!