On 10/28/10 11:10 AM, chaouche yacine wrote: > I guess I'll have to read all of the tutorial before getting it, because > right now, I stopped at bizobj relations and its not very clear. > > For example : > >> Dabo makes it easy to use the key relationship. > > The foreign keys relationships ? > >> bizobj.ParentLinkField = "pkid" # the unique customer key > > This maps to CustomerTable.Columns.PrimarKey ? (pseudo code)
Yes. >> bizobj.LinkField = "fk_clientid" # the foreign key in orders > > This maps to OrdersTable.Columns.ForeignKeyToClient ? Yes. >> bizobj.FillLinkFromParent = True # a way to track new records Did "a way to track new records" come from the tutorial? If so it is misleading (or just out of context maybe). FillLinkFromParent simply tells Dabo whether or not to fill in the foreign key (fk_clientid) in a new child record (orders). http://paul.dabodev.com/doc/api/dabodoc/dabo.biz.dBizobj.dBizobj.html#Properties_FillLinkFromParent > What happens if this is set to False ? When you create a new record in the orders table, fk_clientid remains at None, instead of getting the value of customers.pkid. >> After you define the relationship Dabo takes care of keeping the >> relationship valid > > i.e : no orders with that have no customer or an unknown customer_id ? No, Dabo would by default let you save data that wasn't valid. You need to either enforce this at the database level or by writing rules at the bizobj level. >> If you move to a new customer record the orders table will follow. > > You mean in the UI ? In the customers bizobj, if you move to the next record, the orders table will be requeried automatically to match the current customer. The UI will naturally follow. > If that's what you mean, setting bizobj.FillLinkFromParent to False in the > orders table will not make the orders table follow (in the UI) ? It will still follow. The only thing FillLinkFromParent sets is whether or not a new child record automatically gets its ParentLinkField value filled in. If you don't want the orders table to "follow" the customers table, you could set bizOrders.RequeryWithParent to False. http://paul.dabodev.com/doc/api/dabodoc/dabo.biz.dBizobj.dBizobj.html#Properties_RequeryWithParent > Sorry for asking these questions before reading all through the tutorial. > There are great chances that I may answer myself after doing that :) so feel > free to ignore my comments. No problem. You'll get it soon enough. Welcome! 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]
