Vinnige & Maklik: Skep 'n gids en Ken 'n tipe inhoud (Of, Jou KPI's en hulle eet ook)

Ten einde te werk om 'n KPI probleem Ek het oor hier, I did some testing and discovered that KPI’s work against folders with meta data in the same way that they work against documents or list items. I proved it out by creating a new content type based on the folder content type and then added a few fields. I created some indicators and proved to myself that KPIs work as expected. This was welcome news. It’s not perfect, because the drill-down you get from the KPI against the folders is not exactly what you want. This isn’t too much a drawback in my case because 1) die einde gebruikers nie 'n beter en weet 2) the drill-down goes to a folder. They click the folder name and they are at the item. It’s two clicks instead of one, dit is nie die einde van die wêreld.

This flowed nicely with the work I was doing. I am creating a folder for every document that gets uploaded. This is done via an event receiver. As 'n gevolg, dit is 'n stukkie van die koek te hou van die ouer gids meta data in sync with the KPI-driven meta data from the file itself since the plumbing is already in place. This allows me to have my KPI’s and eat them too 🙂

I modified the event receiver to add the folder and then set this new folder’s content type to my custom KPI-friendly content type. This bit of code did the trick:

 SPFolderCollection srcFolders = targetWeb.GetFolder("Dokumente").Subgidse;
  SPFolder addedFolder = srcFolders.Add(properties.ListItem.ID.ToString());
  SPContentTypeId kpiCT = nuwe SPContentTypeId("0x0120002A666CAA9176DC4AA8CBAA9DC6B4039F");
  addedFolder.Item["Content Type ID"] = KpiCT;
  addedFolder.Item.Update();

Die werklike inhoud Type ID op te spoor, Ek verkry dat die inhoud tipe via site instellings en afskrif / geplak van die URL soos getoon:

beeld

</einde>

Skryf in op my blog!

Technorati Tags: ,

Een gedagte oor “Vinnige & Maklik: Skep 'n gids en Ken 'n tipe inhoud (Of, Jou KPI's en hulle eet ook)

  1. Ron het geskryf:
    This doesn’t work. I have tried it multiple times. Trying to use KPIs against a task list folder.
    Tensy jy die kode te gebruik om dit te kry om te werk – Ek het nie die vermoë om te verander.
    If you don’t need the code maybe you could expand on your explanation of creating the new folder content type. I’m using SharePoint 2007.
    Antwoord

Laat 'n antwoord

Jou e-posadres sal nie gepubliseer word nie. Verpligte velde gemerk *