Forum users frequently as questions like this:
> Please tell me if there are any possibilities to build a custom list with
> master and detail type (like invoices) without using InfoPath.
SharePoint provides some out of the box features that support kinds of business requirements like that.
In general, one links two lists together using a lookup column. List A contains the invoice header information and list B contains invoice details.
Use additional lists to maintain customer numbers, product numbers, etc.
Use a content query web part (in MOSS only) and/or a data view web part to create merged views of the lists. SQL Server Reporting Services (SRS) is also available for the reporting side of it.
However, there are some important limitations that will make it difficult to use pure out-of-the-box features for anything that is even moderately complex. These include:
- Size of related lookup lists vs. "smartness" of the lookup column type. A lookup column type presents itself on the UI differently depending on whether you’ve enabled multi-select or not. In either case, the out-of-the-box control shows all available items from the source list. If the source list has 1,000 items, that’s going to be a problem. The lookup control does not page through those items. Instead, it pulls all of them into the control. That makes for a very awkward user interface both in terms of data entry and performance.
- Lookups "pull back" one column of information. You can never pull back more than one column of information from the source list. For instance, you cannot select a customer "12345" and display the number as well as the customer’s name and address at the same time. The lookup only shows the customer number and nothing else. This makes for an awkward and difficult user interface.
- No intra-form communication. I’ve written about this here. You can’t implement cascading drop-downs, conditionally enable/disable fields, etc.
- No cascading deletes or built-in referential integrity. SharePoint treats custom lists as independent entities and does not allow you to link them to each other in a traditional ERD sense. For example, SharePoint allows you to create two custom lists, "customer" and "invoice header". You can create an invoice header that links back to a customer in the customer list. Then, you can delete the customer from the list. Out of the box, there is no way to prevent this. To solve this kind of problem, you would normally use event handlers.
It may seem bleak, but I would still use SharePoint as a starting point for building this kind of functionality. Though there are gaps between what you need in a solution, SharePoint enables us to fill those gaps using tools such as:
The last option may feel like you’re starting from scratch, but consider the fact that the SharePoint platform starts you off with the following key features:
- Security model with maintenance.
- Menu system with maintenance.
- "Master table" (i.e. custom lists) with security, built-in maintenance and auditing.
- Back end integration tools (BDC).
If you start with a new blank project in visual studio, you have a lot of infrastructure and plumbing to build before you get close to what SharePoint offers.
I do believe that Microsoft intends to extend SharePoint in this direction of application development. It seems like a natural extension to the existing SharePoint base. Microsoft’s CRM application provides a great deal of extensibility of the types needed to support header/detail application development. Although those features are in CRM, the technology is obviously available to the SharePoint development team and I expect that it will make its way into the SharePoint product by end of 2008. If anyone has an knowledge or insight into this, please leave a comment.