Did you try the 'requires' separately, eg db.define_table('ts_mileage_rate', Field('customer_id', 'reference ts_customer', required=True, notnull=True), Field('mileage_rate_year', 'integer', required=True, notnull=True))
db.ts_mileage_rate.mileage_rate_year.requires=IS_NOT_IN_DB(db(db.ts_mileage_rate.customer_id == request.vars.customer_id), 'ts_mileage_rate.mileage_rate_year') -- --- 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.