tumby1974
Posts: 26
|
Posted: 09/26/2012, 8:05 AM |
|
If I'm working on a page with record with data from table A, i'd also like to update a field in table B that is kinda related.
I'd like it to update when I update the record for table A (leave the page), so it's hidden behind the scenes.
ex.
when page comes up
Record with data from TABLE A
(hidden code for setting field in TABLE B to -1)
hit "update" or "add" for record, and table A updates with its changes, and table B updates with the hidden change.
both tables can be related via an ID field.
I don't know where to start working on this.
|
|
|
mljonzs
Posts: 124
|
Posted: 09/26/2012, 8:15 AM |
|
Sounds like the easiest thing for you to do is to put your code to update Table B's field into the AfterExecuteUpdate method for the record containing Table A
Or, you might be able to do it by creating an updatable view that has both tables joined together properly and then add code into the BeforeExecuteUpdate method of the record to set the value associated with the field from Table B.
_________________
What does not begin WITH God, will end in failure!
|
|
|
tumby1974
Posts: 26
|
Posted: 09/26/2012, 8:49 AM |
|
ok, thanks!
so, for option 1.....
use SQL code in AfterExecuteUpdate to pull up table B record (that uses the same ID as table A) and change the field I want to -1.
the only thing I've used is ccdlookup in the code section. Would this be similar to using CCDLookup?
|
|
|
|