Re: [dabo-users] Importing data to linked tables

Author: Ed Leafe

Posted: 2012-05-03 at 08:59:57

On May 3, 2012, at 7:09 AM, Charles Brunet wrote:

> No, it seems foreign keys aren't updated on the children rows and keep the

> temp negative value. I will try to manually set the PK value, as you

> suggest. But how can I get the last insert ID? This function exists in the

> cursor class, but not in the bizobj class. Or should I query the DB to get

> the max value for the PK field? Even that I'm not sure how to do it.

That should be done for you if you have a) AutoPopulatePK set to True for the parent bizobj and b) FillLinkFromParent set to True for the child bizobj(s). When those are both set, saving a new parent record will propagate the new parent PK to the child bizobj's foreign key field.

-- Ed Leafe

_______________________________________________

Post Messages to: Dabo-users@leafe.com

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/CE833CA0-7815-4A5D-9721-E939C50A29FD@leafe.com

©2012 Ed Leafe