NetTalk Central

Author Topic: how to force browse reset after delete validate fail  (Read 2425 times)

cwtart

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • CommPay Software
    • Email
how to force browse reset after delete validate fail
« on: July 20, 2013, 05:10:23 AM »
NT7.15

I have a browse/form combo that allows for inserts and deletes. Under some circumstances when a record is deleted it is not really deleted but a flag in the record is set to filter the record out of the browse.

In order to accomplish this I use code in the delete validate embed of the form. This works fine - when the delete button is clicked I set the flag (a byte field that = true or false) in the record - this flag then filters the record from appearing on the browse. But to prevent the actual delete of the record I set loc:invalid = 'something' in the delete validate - the problem is that when loc:invalid is set in delete validate the browse is not reset.

My question is how to reset the browse even though delete validate has prevented the actual deletion of the record.

Thanks,

Chuck




Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: how to force browse reset after delete validate fail
« Reply #1 on: July 22, 2013, 09:51:00 PM »
ahh - at last, and easy one (at least to answer).

In the ValidateDelete routine set the "ans" variable to the new action.
For example;

  mai:Deleted = 1
  ans = net:ChangeRecord


Setting ans here effectivly changes the action from "delete" to "change". Note that the actual file field is being set here, not the session value (although doing both is probably a good idea.)

cheers
Bruce

cwtart

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • CommPay Software
    • Email
Re: how to force browse reset after delete validate fail
« Reply #2 on: July 24, 2013, 05:40:03 AM »
Thank you Bruce - that worked

Chuck