Web Connection
Parent child business objects
Gravatar is a globally recognized avatar based on your email address. Parent child business objects
  Doug
  All
  Jul 16, 2017 @ 08:25am

Looking for an example of performing CRUD on a standard parent/child relation using the wwbusiness class. Got the one to one done. Now need direction on linking children to master object and then displaying/saving. This would be similar to an order/orderdetail scenario.

Thanks, Doug

Gravatar is a globally recognized avatar based on your email address. re: Parent child business objects
  Rick Strahl
  Doug
  Jul 16, 2017 @ 09:06am

You can take a look at the music store sample in the Web Connection demos. Look at MusicStore.prg which is a relatively simple implementation but it should give you a good idea on direction.

There are a number of ways that this can be done.

  • Top level entity that controls children (musicstore does this)
  • Separate entities for parent and child list bus objects

Personally I try to use the first approach whenever possible because in most situations the child relationships are driven through the parent. You can then optionally have a child entity business object to perform special tasks.

The documentation has examples for the Separate entities approach using child business objects using the wwItemList class.

+++ Rick ---

© 1996-2017