Wednesday, April 13, 2011

Visual Studio 2010 VS SharePoint 2007 Workflow

I had issues adding Workflow actions to a SharePoint 2007 Workflow in Visual Studio 2010, all the items where grayed out in the toolbox.

Couple of workarounds:
1) I deleted all the 14.0 SharePoint Workflow Actions, then added the 12.0 ones
-Right click inside your toolbox
-Click on Show All
-For each item in the toolbox under SharePoint Workflow, select it and hit delete on your keyboard
-Right click inside your toolbox again
-Click on Choose Items...
-Click on Browse...
-Browse to microsoft.sharepoint.WorkflowActions.dll (Mine was under C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\)

From that point the Actions where selectable in the toolbox

2) If you have an existing workflow you can copy the actions from there

3) I heard that you can edit the designer.cs file directly, I have not tried it.

Friday, April 1, 2011

Parse XML string in jQuery

Some will tell you that you can load an xml string into jQuery and read it. However, I found that I needed to load my string into an XMLDOM object first and then use jQuery. Like this:

   var data = "<Item><Param>Value</Param></Item>";
   var doc = new ActiveXObject("Microsoft.XMLDOM");
   doc.loadXML(data);
   $(doc).find("Item").each(
    function () {
     var param = $(this).find("Param").first().text();
     alert(param);
    }
   );