-
Using Meta data to update other fields based on entries in a field
I'm working on some code to sync my Liana databases with my Xcase model.
Is the following possible in Lianja, using meta data so that I can simply update the meta data rather than having code in the UI.
Three fields
The mother of an animal cfk_danimal - foreign key to the animal table
The father of an animal cfk_danimal0 - foreign key to the animal table
The species of their offspring cfk_dtaxon - foreign key to the species table
In my current vfp system I have in Xcase some code in the cfk_dtaxon column that if cfk_daniml or cfk_danimal0 changes the code goes off and using those values returns the cfk_dtaxon value for the offering.
All the code I have, just truing to figure out how to fire this using meta data in Lianja.\
Another scenario might be three logical columns used as checkboxes on a page
A, B, C
Only one can be checked. If A is checked and user checks B then A unchecks itself.
I know this is easy to do in the pages themselves, but if I can do it via meta data then I never have to lay hunt the code when I want to alter anything as it woudl all come from my Xcase model and be put into meta data by my conversion program.
-
HI David,
when a control changes, you then need to query the metadata, which might looks like "f2ref:" followed by an array of other columns to do things with, or might reference a prg. The metadata doesn't do the work: it's the code traffic controller information.
Hank
PS: you could do this in field triggers as well -- but that means you have to know where the code is running (don't want it running twice).
PPS: for those who think calculated and recalculate would do the trick: scenarios exist where field a changes field b but field b then changes field c Plus field b can be changed independently and has to change field c. A calculated field can't also be a modifiable (recalculate) field.
Last edited by HankFay; 2021-03-11 at 04:18.
-
Thanks Hank,
Yes that is what I meant, a call to my own prg do do the work, just need to know how to trigger that via metadata
-
This is your magic page: the attribute names for Fields: https://www.lianja.com/doc/index.php/Field_Attributes
The Change event is the one you want: https://www.lianja.com/doc/index.php/Custom_Delegates#Change
If you find data controls where there is no such event delegate, you know where to submit an ER. <gd&r from Barry>.
Hank
-
Thanks Hank, that looks very promising.
David
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks