The 'next' URL literally has to contain the substring '[id]', so you would probably need to do:
next=URL('b') + '/[id]' There is a newer feature that allows you to replace any of the form vars in the URL via Python string formatting notation: next=URL('b') + '/%(id)s' Note, I don't think you can specify the latter part of the URL as the 'args' argument to URL() because the special characters will end up getting escaped. Anthony On Saturday, November 12, 2011 4:51:39 PM UTC-5, tsvim wrote: > > Hi, > > In my current project I have a function (a) in the controller which > calls Crud to create a new record. After which function (a) sends the > user to function (b) using the "next" directive in Crud. I'd like to > have function (b) know the id of the record created which sent them > over so it could store the reference in one of it's fields. > > I tried setting args=id, args=[id], args="id" but nothing seems to > work. I'd greatly appreciate your help. > > Thanks, > > Tsvi Mostovicz > > Here follows the code I have at the moment: > > def a(): > form = crud.create(db.a, > next=URL(args=[id],f='b')) > return dict(form=form) > > def b(): > form = crud.create(db.b) > a = db(db.b.settings==request.args(0)).select() > return dict(a=a, form=form)