i achieve it using your detail explaination in this forum.

ref:
https://groups.google.com/forum/#!topic/web2py/ShebcblC9pM

just a little info, ondelete callback not work in edit mode 
(delete_this_record check box) so that i must use onvalidation to check the 
value of delete_this_record.
e.g. 
def __onvalidation_purchase_order(form):
if request.args(-3) == 'edit' and request.args(-2) == 
'purchase_order_header':
if form.vars.is_authorized == 'on': #for authorized
form.vars.status = 'Purchase Order Authorized'
row_header = 
db(db.purchase_order_header.id==request.vars.id).select().first()
db(db.purchase_requisition_header.id==row_header.purchase_requisition_no).update(status='Purchase
 
Requisition Purchase Order Authorized')
if request.args(-3) == 'edit' and request.args(-2) == 
'purchase_order_header':
if form.vars.delete_this_record == 'on': #for delete
row_header = 
db(db.purchase_order_header.id==request.vars.id).select().first()
db(db.purchase_requisition_header.id==row_header.purchase_requisition_no).update(status='Purchase
 
Requisition Authorized')
else:
None

def __ondelete_purchase_order(table_involved, id_of_the_deleted_record):
row_header = table_involved(id_of_the_deleted_record)
db(db.purchase_requisition_header.id==row_header.purchase_requisition_no).update(status='Purchase
 
Requisition Authorized')

thank you so much and best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to