Can someone help me with this. I just want to run the salescheck sql method and use a field 'OFFICENAME' in the result set in the message. It is a simple task and it's been bugging me far to long. Thank for your help. orderrecordok = context.salescheck(locationid = request.LOCID, RECID = request.ID) if not orderrecordok: return context.REQUEST.RESPONSE.redirect("%s?message=%s" % (context.REQUEST.URL1,' Sorry the Order ' + salescheck.OFFICENAME + ' is not yours'))
Jonathan Miles schrieb:
Can someone help me with this.
I just want to run the salescheck sql method and use a field 'OFFICENAME' in the result set in the message.
It is a simple task and it's been bugging me far to long.
Thank for your help.
orderrecordok = context.salescheck(locationid = request.LOCID, RECID = request.ID)
if not orderrecordok:
return context.REQUEST.RESPONSE.redirect("%s?message=%s" % (context.REQUEST.URL1,' Sorry the Order ' + salescheck.OFFICENAME + ' is not yours'))
Hmm, and what exactly is your problem? But I already see some issues. First, you should check that OFFICENAME comes from the right source. What you're doing here is calling the method or attribute "OFFICENAME" from the object "salescheck" (which either is a SQL method and thus probably has no such member, but then the leading "context." is missing; or it's a variable you defined before). And you can't get it from your result named "orderrecordok", 'cause you just checked that for being empty... Another point could be that the message must appear within quotes in the URL, but I'm not sure about that. Try again, and *please* post with a more detailed description of your *problem* (including error messages etc.) next time... Martin
Jonathan Miles wrote at 2003-1-16 00:21 -0000:
Can someone help me with this.
I just want to run the salescheck sql method and use a field 'OFFICENAME' in the result set in the message.
It is a simple task and it's been bugging me far to long.
Thank for your help.
orderrecordok = context.salescheck(locationid = request.LOCID, RECID = request.ID)
if not orderrecordok:
return context.REQUEST.RESPONSE.redirect("%s?message=%s" % (context.REQUEST.URL1,' Sorry the Order ' + salescheck.OFFICENAME + ' is not yours')) Apparently, when you run "salescheck", it returns an empty result set. Of course, you cannot access a field in an empty result set.
If you have a non-empty result set "R", then "R[i]" is the i-th result row (0-based) and "R[i].OFFICENAME" would give you the "OFFICENAME" field of this row. Dieter
participants (3)
-
Dieter Maurer -
Jonathan Miles -
Martin Gebert