שנעל & גרינג: שאַפֿן אַ פאָלדער און באַשטימען אַ אינהאַלט טיפּ (אָדער, האָבן אייער קפּיס און עסן זיי טו)

אין סדר צו אַרבעטן אַרום אַ קפּי פּראָבלעם איך געשריבן וועגן דאָ, 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) דער סוף ניצערס טאָן נישט וויסן קיין בעסער און 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, which isn’t the end of the world.

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. ווי אַ רעזולטאַט, it’s a piece of cake to keep the parent folder’s meta data in sync with the KPI-driven meta data from the file itself since the plumbing is already in place. דאָס אַלאַוז מיר צו האָבן מיין קפּי ס און זיי אויך עסן 🙂

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("Documents").SubFolders;
  ספּפאָלדער addedFolder = srcFolders.Add(properties.ListItem.ID.ToString());
  SPContentTypeId kpiCT = נייַ SPContentTypeId("0x0120002A666CAA9176DC4AA8CBAA9DC6B4039F");
  addedFolder.Item["Content Type ID"] = kpiCT;
  addedFolder.Item.Update();

To locate the actual Content Type ID, I accessed that content type via site settings and copy/pasted it from the URL as shown:

בילד

</עק>

אַבאָנירן צו מיין בלאָג!

איינער געדאַנק אויף "שנעל & גרינג: שאַפֿן אַ פאָלדער און באַשטימען אַ אינהאַלט טיפּ (אָדער, האָבן אייער קפּיס און עסן זיי טו)

  1. Ron wrote:
    This doesn’t work. I have tried it multiple times. Trying to use KPIs against a task list folder.
    Unless you have to use the code to get it to work – which I don’t have the ability to change.
    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.

לאָזן אַ ענטפֿערן

אייער בליצפּאָסט אַדרעס וועט ניט זיין ארויס. Required fields are marked *