Mabilis & Madali: Lumikha ng isang Folder at Magtalaga ng isang Uri ng Nilalaman (O, May ang iyong KPIs at Kumain kanila Masyadong)

Upang gumawa sa paligid ng isang KPI problema Ko sinulat ni tungkol dito, 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) ang mga end user ay hindi alam ang anumang mas mahusay at 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, na kung saan ay hindi ang dulo ng mundo.

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. Bilang isang resulta, ito ay isang piraso ng keyk upang panatilihin ang mga parent folder ni 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("Documents").Subfolder;
  SPFolder Idinagdag folder = srcFolders.Add(properties.ListItem.ID.ToString());
  SPContentTypeId kpiCT = bago SPContentTypeId("0x0120002A666CAA9176DC4AA8CBAA9DC6B4039F");
  addedFolder.Item["Content Type ID"] = kpiCT;
  addedFolder.Item.Update();

Upang mahanap ang aktwal na Nilalaman Uri ng ID, I-access na uri ng nilalaman sa pamamagitan ng mga setting ng site at kopyahin / paste ito mula sa URL tulad ng ipinapakita:

imahen

</dulo>

Mag-subscribe sa aking blog!

Technorati Tags: ,

Isa naisip sa "Mabilis & Madali: Lumikha ng isang Folder at Magtalaga ng isang Uri ng Nilalaman (O, May ang iyong KPIs at Kumain kanila Masyadong)

  1. Sinulat ni Ron:
    This doesn’t work. I have tried it multiple times. Trying to use KPIs against a task list folder.
    Maliban kung mayroon kang gamitin ang code upang makakuha ng ito upang gumana – na hindi ko ay may kakayahang baguhin.
    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.
    Sumagot

-Iwan ng sagot

Ang iyong email address ay hindi nai-publish. Mga kinakailangang patlang ay minarkahan *