What's the best way to support aggregate data structures using content types? For example, if I have an order processing system, then I might have data types like Order and OrderLineItem, where each Order may have reference to none or more OrderLineItems. How do I model this relationship with content types?

Do I base the Order content type on the built-in Folder type? Do I have separate content types where an OrderLineItem content type would contain a lookup field of an Order, and then heavily customized forms to render this on the Orders list?


Well, you can do parent child relationships with content types, where Order and OrderLineItem might inherit from Order Master, where Order master has all the common fields that Order and OrderLineItem contain. Then each of those content types have other columns unique to them.

Based on what your saying, I might have something like an Orders list that holds an orders content type. Then have a LineItem list that has the OrdersLineItem content type in it. That content type would have a lookup to the Orders list ID column or Order Number, what ever you're using as the "Primary Key".

  • Right, but what I'd like to accomplish is building a single form for the user where an order and all of its line items can be entered together. If I go the two-list route, then my order list forms and views would have to be pretty heavily customize, right? – Ben Collins Nov 16 '11 at 19:10
  • 1
    Somewhat for the new/edit forms, not so much for display forms. InfoPath might be a better option, then you can put in a repeating section for the line items, then promote what you need to to columns in the document library. – Eric Alexander Nov 16 '11 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.