Ed Leafe wrote: > On Sep 24, 2008, at 12:22 PM, Paul McNett wrote: > >> And I'll reiterate again that I do this all the time, by using >> biz.DefaultValues["pk"] = myFunc. It works without any special >> workaround. > > > But if you were to change the PK between that initial assignment and > saving, it would not work. That's the difference between your system > and Sibylle's: since your PK is assigned early, it appears in the > cursor's _newRecords dict. Sybylle defaults to no value, so None gets > stored in _newRecords. Later when the record is being saved, the > manually-changed PK is checked against _newRecords, and it is not > found. So Dabo treats it as an update instead of an insert, and we get > the bug that was observed.
On one hand, so much of dCursor and dBizobj rely on the PK not changing. OTOH, we could probably hook into setFieldVal() so that, if it is the PK value changing, we can re-sync the _newRecords dict with the new pk value. Paul _______________________________________________ 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/[EMAIL PROTECTED]
