Implementar Mestre / Relación detalles utilizando listas personalizadas

Os usuarios do foro a miúdo como preguntas como esta:

> Ola,
>
> Por favor, me diga se hai posibilidades de construír unha lista personalizada con
> Tipo de mestre e de detalles (como facturas) sen usar InfoPath.
>

SharePoint ofrece algúns fóra das características da caixa que soportan tipos de requisitos de negocios coma este.

En xeral, one links two lists together using a lookup column. List A contains the invoice header information and list B contains invoice details.

Usa as listas adicionais para manter o número de clientes, números de produtos, etc.

Usar a consulta de contidos web part (en só Moss) and/or a data view web part to create merged views of the lists. SQL Server Reporting Services (SRS) tamén está dispoñible para o lado da mesma comunicación.

Con todo, 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:

  • Tamaño da investigación relacionada listas 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. Pola, 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. Por exemplo, 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. Eu escribín sobre iso aquí. You can’t implement cascading drop-downs, condicional activar / desactivar campos, 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. Por exemplo, SharePoint permite que cree dúas listas personalizadas, "customer" and "invoice header". You can create an invoice header that links back to a customer in the customer list. Entón, you can delete the customer from the list. Fóra da caixa, there is no way to prevent this. To solve this kind of problem, usaría normalmente manipuladores de eventos.

Pode parecer sombrío, 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 permite cubrir esas lagoas usando ferramentas como:

  • Event handlers. Use them to enforce referential integrity.
  • Columnas personalizadas: Create custom column types and use them in lieu of the default lookup column. Add paging, buffer e os recursos AJAX para facelas sensibles.
  • BDC. This MOSS-only feature enables us to query other SharePoint lists with a superior user interface to the usual lookup column. BDC can also reach out to a back end server application. Use BDC to avoid replication. Rather than replicating customer information from a back end ERP system, use BDC instead. BDC features provide a nice user interface to pull that information directly from the ERP system where it belongs and avoids the hassle of maintaining a replication solution.

    BDC é unha característica Moss (non está dispoñible no WSS) and is challenging to configure.

  • Formulario web ASP.NET: Crear un formulario habilitados para AJAX completo que utiliza o modelo de obxecto do SharePoint e / ou servizos web para alavancar as listas do SharePoint, que proporciona unha interface de usuario moi sensible.

A última opción pode sentir como se está empezando de cero, pero considerar o feito de que a plataforma SharePoint comeza fóra coas seguintes características principais:

  • Modelo de seguridade co mantemento.
  • Sistema de menú co mantemento.
  • "Master table" (i.e. Contraer personalizadas) con seguridade, built-in de mantemento e auditoría.
  • Procurar.
  • Volver acabar ferramentas de integración (BDC).

Se comeza cun novo proxecto en branco no visual studio, ten unha morea de infraestrutura e encanamento para construír antes de chegar preto do que o SharePoint ofrece.

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, por favor, deixe un comentario.

</final>

5 pensamentos sobre "Implementar Mestre / Relación detalles utilizando listas personalizadas

  1. Paul Galvin

    Raghu, I don’t think there’s any easy way to do that. I would focus on training your users when to use which one of them and maybe give them a hint with the name of the content type itself. I don’t think you can really nail this one down, technically.

    Responder
  2. Raghu wrote:
    I am creating Parent/Child realationship by using two content types and custom list as explained in the above commnet. But I have a problem; I need to make Item content type unavailable at Folder level and Folder content type unavailable at item level. Please guide me on this one. Grazas…
    Responder
  3. Michael Vickers

    It’s a bit of a kludge but I use an ASP.Net dropdown which shadows the lookup "dropdown" generated by SharePoint. I point the ASP.Net dropdown to a datasource based on the list containing the lookup item, allowing me to use the ID field as the value and the column of my choice as the display text. I do not bind the ASP.Net dropdown to the lookup list field because it generates server-side errors.

    On page load I use javascript to assign the correct value to the ASP.Net dropdown, and then attach onchange events to that dropdown to assign new values to the corresponding SharePoint lookup dropdown. I actually hide the row containing the SharePoint dropdown.

    One last thing — because of the way SharePoint renders goofy lookup dropdowns when the number of items gets past 20 I use custom wrapper object to get/set the dropdown value. I have a blog post detailing that process here:

    http://www.idiotsyncrasies.com/2007/12/lookup-list-dropdowns-in-sharepoint.aspx

    Saúde,

    Michael

    Responder
  4. David

    You can create a Content Type for Invoice header based on the Folder Content Type and then create another Invoice Content Type and add both to a SharePoint list. This in effect creates a Parent/Child relationship which will allow you to create multiple Invoices based on the Invoice Content Type that live under the Invoice Header Content Type which gives you and instant relationship between the two items and if the Invoice Header list item is deleted all the child Invoice items within that Folder will be deleted. You can also specify that a Content Type only be available from within a certain Folder. This approach is similar to how the discussion library works and is very helpful for this type of relationship between items. Os manipuladores de eventos e código axudará con algunhas outras limitacións, mais en xeral unha solución rápida e fácil.

    Responder

Deixe unha resposta

Enderezo de correo electrónico non será publicado. Os campos obrigatorios están marcados *