Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find the CA alias name
Message
From
20/04/2022 07:31:15
 
 
To
19/04/2022 14:39:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01684184
Message ID:
01684194
Views:
63
Hi Hank,

that is one way of looking at it. I prefer the CA (except for timecritical huge updates) for the hooks it offers as well as the subclassing ability. IMO CA is a nice place to consolidate all your field and record validations esp. if you support different backends. If you have strict validation needs from desktop app, creating rules in a single backend like SQL or ProgreSQL server is much safer, but I consider web sites calling vfp COM to optionally different backends safe enough as CA component runs inside safe web server - so should conceptually work for Lianja as well.

This is IMO also better than DBC validation and much better than form based validation, as the relevant CA is also runtime available via GetCursoradapter(tcAlias) and validation methods placed there can be called from multiple forms without bloating GUI with "intelligence".

Tried both with method name rules or separate validation cmd addobjected: liked both...

my 0.22€
thomas

>A CA is just a way of creating a view instance. Once created, you can treat the cursor like any other cursor. as you discovered.
>
>With the right code in the BeforeOpenTables event in the DE, you can in fact substitute a CA for a view or table that is in the DE. Everything just works. There are little differences (e.g., if your code looks for "sourcetype" = 2, the CA will be 102), easily worked around.
>
>Hank
>
>>I found, since I posted the initial message, that the OLDVAL() works without the alias. That is, I can use:
>>
>>OLDVAL( field_name)
>>
>>
>>And in my initial test the above works. I just need to do more tests to be sure that the above OLDVAL() actually uses the current form CA alias and not some other. Because the same field name could be in more than one CA aliases.
>>
>>As to your questions, I don't know how to get "YourCA" value.
>>
>>Thanks.
>>
>>>I don't use CA, but I use Help frequently. May I guess YourCA.Alias?
>>>
>>>>Hi,
>>>>
>>>>On a typical form of my VFP 9 application, at design time, I drop various textboxs (this is simplified). The class of the "textbox" has a method .Validate(). This method has to check if the value in the field has been changed. I can easily get the current value in the text box. But I also need to find the OLDVAL() in this textbox. To do so, I would need the alias name of the CA (Cursor Adapter) for this particular form.
>>>>Could you suggest a generic way to get the alias name of the CA, on any form, for a textbox?
>>>>
>>>>TIA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform