I have a set of criteria that I am evaluating prior to opening an Update Form. The criteria are being correctly evaluated, but I am at a loss for figuring out how to get the Update Form from being opened.
The criteria are in the "Browse Box Before Insert/Update a Record From Browse Box on Sessions" embed point.
How do I stop the Form form appearing?
It might be easier to put the logic in the form and exit before it goes too far.
I’d use window.init after opening files, assuming your criteria uses file info, and return level:Cancel if it fails.
Oops Legacy. Not sure of the embed, but you should get the idea
Try in the Ask method for the Browse before parent.
A potential problem with that is that it will add a record to the database on insert, which might not be desirable.
I don’t remember anything about legacy templates, but it might be worth looking at the browse code in the embeditor and looking for place(s) where the update form is called, then find an appropriate embed point to intercede.
Thank you all for taking a look, I solved it by using the BEFORE GENERATED CODE/SELECTED embed.
Oh yes, the topspeed file autoinc is different from sql, so Ask might not be the appropriate method. However, for a browse on an sql view it might be desirable to evaluate the update criteria as late as possible.