No errors - but the validation did not work ie I was able to delete a record
that was 'in use' . This implies to me that no records were returned by the
sql statement. Here are my 2 versions :-
This one works :-
def beforeDelete(self):
ret = ""
# if a member has this type do not allow delete
app = self.Application
dCon = app.getConnectionByName("LodgeBooks")
con = dCon.getConnection()
curs = con.cursor()
curs.execute("select * from Members where MembershipType = %s" %
(self.Record.MTypeID))
if curs.fetchone() != None:
ret = "value in use."
return ret
This one does not :-
def beforeDelete(self):
ret = ""
# if a member has this type do not allow delete
curs = self.getTempCursor()
curs.execute("select * from Members where MembershipType = %s" %
(self.Record.MTypeID))
if curs.fetchone() != None:
ret = "value in use."
return ret
----- Original Message -----
From: "Uwe Grauer" <[email protected]>
To: "Dabo Users list" <[email protected]>
Sent: Tuesday, January 20, 2009 11:02 AM
Subject: Re: [dabo-users] Validation before Delete
> Roger Lovelock wrote:
>> Didn't seem to work for me - I suspect because I was querying a different
>> table in the database and (I think) the temp cursor only relates to the
>> current bizObj.
>
> What does "Didn't seem to work for me" mean?
> Did you get any errors?
>
> Uwe
>
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/5dae5a30ca84447f8f9598cfeaeda...@roger