O7 -> O$ prompted find
Thanks for your email.
It’s an evAfter on the field.
In our own modular system, we create a $validate() method behind each field, and when the user clicks Save, we do a $sendall() to call the validate routine.
However, since we inherited this from another developer, it isn’t built like that. What we ended up doing was to create an instance var called “iWinMode” which was set to “FIND” when we are in prompted find mode, and blank otherwise. Down the track if we need to be aware of other modes eg insert/edit, then we’ll change the string accordingly. At the moment we’re adding this on a case-by-case basis. I don’t want to go through 400+ windows to add two lines of code to each event eg if iWinMode<>‘FIND’ … end if. That’s why I was hoping there might be something built-in…
> On 20 Mar 2018, at 12:00 am, email@example.com wrote:
> Which events are triggering the validation code?
> We try to stay away from adding validation code behind fields so that
> users don’t get stuck while entering data. Instead we have a
> $checkInsertEdit() method that is called when the user saves the data.
> That said, an instance var to determine what type of input you expect is
> not a bad idea. We defined a short integer in our super window:
> 1=insert, 2=edit, 3=find.
> Best regards,
> Nick Renders
> On 14 Mar 2018, at 8:22, Paul Mulroney wrote:
>> Hi Everyone,
>> I’m converting an Omnis 7 app to Omnis Studio. I’ve discovered that if
>> you have a “prompted find”, in Studio you get events now, whereas in
>> Omnis 7 during prompted find you didn’t. This is causing some grief
>> because all the validation code is complaining about fields missing
>> values etc.
>> Is there an easy way to say “during prompted find, don’t execute any
>> events”? Can I even tell if I’m in prompted find mode using a
>> built-in property or method? At the moment I’m resigned to setting an
>> instance var that says “Hey, I’m in find mode”, and in every $event
>> having a “if I’m not in Find mode…”. Some of these windows have a
>> few fields…
I bought my friend an elephant for his room. He said “Thanks” I said “Don’t mention it”
Paul W. Mulroney We Don’t Do Simple Pty Ltd
firstname.lastname@example.org Trading as Logical Developments
www.logicaldevelopments.com.au ACN 161 009 374
Ph: +61 8 9458 3889 86 Coolgardie Street
BENTLEY WA 6102