Setting the SharePoint Event Folder name dynamically

  • 21 February 2006
  • 4 replies
  • 5 views

Badge +3
I have a Doc library on WSS and each day a folder gets created in that lib for keeping logs for that day. Now when a special log file (with some unique name) is inserted there a process should start in k2. So I used the SharePoint Process Wizard. In the second window of the wizard, I need to select the SharePoint Event Folder. But since my folder name keeps changing everyday, how can i Dynamically set the folder name here, so that the K2 process starts when the special log file gets uploaded there. My folders have a special format for naming. Their name have the following format YYMMDD.
How to change the folder name in code?.

Also the K2 process should only start when that particular log file is inserted in the new folder. SO where should i check for that filename. And only fire up the k2 process when that fiel gets inserted.

Regards,
N

4 replies

Badge +3
nfaz,

i removed my post to avoid adding noise and confusion to this forum. the proper response and level of detail are available in subsequent posts.

sherif
Badge +2
Event mapping are stored in a "K2.net Events" list. Each day when a new folder is created the particular list item that maps to your previous days folder needs to be changed.

The DocumentLibrary field in this list would need to change to: Mydoclib/YYMMDD
Badge +3
Hi henniee,

Thankyou for your reply. But can you please elaborate how it is be done. Where should i check for K2.net Events list. Actually i am a newbie to K2. So please bear with me. Any help will be appreciated.

Regards
N
Badge +2
Hi

The "K2.net Events" list is located in the same site as your document library.

I would guess that the new folder is created programaticaaly each day. After the createtion of this folder you will need to change the value of the DocumentLibrary field.

The easiest way to go about this is write your own web service.
The code you would use will look something like this

;
ListItems = list.Items;

foreach (SPListItem ListItem In ListItems)
{
if ( ListItem("DocumentLibrary") == "FolderYesterdays YYMMDD" )
{
// Change the value
ListItem("DocumentLibrary") = "FolderToDays YYMMDD";
break;
}
}

listItem.Update();


For more on writing your own web service:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_sp2003_ta/html/odc_writingcustomwebservicesforsppt.asp

Regards

Reply