Adi, can you post the model for this?
thanks, Alex Glaros On Friday, December 23, 2011 9:44:17 AM UTC-8, Adi wrote: > > this works: > > grid=SQLFORM.smartgrid(db.purchase_order, details=False, > links_in_grid=True, > maxtextlengths={'purchase_order.po_number':15,}, > maxtextlength=30, > paginate=20, > sortable=True, > > orderby=dict(purchase_order=[~db.purchase_order.modified_on], ), > oncreate = dict(purchase_order=[po_oncreation]), > csv=False, > ui='jquery-ui', > links=dict(purchase_order=[lambda row: > A('Duplicate', > _class='button', > _href=URL('duplicate_purchase_order',args=[row.id])), lambda row: > A('Print', > _class='button', _href=URL('print_all',args=[ > row.id]))]), > user_signature=False, onupdate=auth.archive, > ) > > > def po_oncreation(form1): > > auth.archive > > last_id = form1.vars.id > > row = db(db.purchase_order.id==last_id).select().first() > > str_po_number = row.po_number + str(row.id) > row.po_number = str_po_number > row.update_record() > > #response.flash = 'Added a Purchase Order' > > session.flash = 'Added a Purchase Order' > return > > > > -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.