开发者

Sharepoint Edit Form Error

I cant find a glue for that. Trying to edit a Listitem in the Browser , I get an Error the Log says:

File Not Found: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Layouts\EditingMenu\SiteAction.xml System.ArgumentNullException: Der Wert darf nicht NULL sein. Parametername: s bei System.IO.StringReader..ctor(String s) bei System.Xml.XmlDocument.LoadXml(String xml) bei Microsoft.SharePoint.Publishing.Internal.WorkflowUtilities.FlattenXmlToHashtable(String strXml) bei Microsoft.SharePoint.Publishing.Internal.WorkflowUtilities.DoesWorkflowCancelWhenItemEdited(String associationXml) bei Microsoft.SharePoint.Publishing.WebControls.ConsoleDataSource.EnsurePageNotInLockingWorkflowIfInEditMode() bei Microsoft.SharePoint.Publishing.WebControls.ConsoleDataSource.OnPreRender(EventArgs e) bei System.W开发者_运维问答eb.UI.Control.PreRenderRecursiveInternal() bei System.Web.UI.Control.PreRenderRecursiveInternal() bei System.Web.UI.Control.PreRenderRecursiveInternal() bei Sy... 489b3ebb-eb93-4172- SharePoint Foundation Runtime tkau Unexpected System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

The Xml is in Place and Edit Forms for Other Lists in the same Web are working well ... Even Tried to make a new Editform ( and iisreset etc..)

Any Hint would be helpfull

Thanks Lars


The exception is thrown because the SharePoint 2010 expects that the AssociationData element contains a valid xml, where AssociationData element is a tag in Workflow Definition Schema. I've faced this issue after migrating our SP 2007 application to SP 2010. Unfortunately, it's not enough to just apply a valid xml to AssociationData element in your workflow definition:

It helps only for applications and workflow instances created/started after modifications have been made. Therefore, for live applications and started workflow instances we have to change AssociationData through the object model. I implemented the set of methods I described here - SharePoint: Workflow + List Item Edit Form = Value cannot be null Exception. The basic methods are listed below:

public static void AdjustAssociationData(SPWorkflowAssociation workflowAssociation, SPWorkflowAssociationCollection collection)
{
    if (!IsValidXml(workflowAssociation.AssociationData))
    {
        string newValue = string.IsNullOrEmpty(workflowAssociation.AssociationData)
                                ? "<Data />"
                                : string.Format("<Data>{0}</Data>", workflowAssociation.AssociationData);
        workflowAssociation.AssociationData = newValue;
        collection.Update(workflowAssociation);
    }
}

public static bool IsValidXml(string str)
{
    if (!string.IsNullOrEmpty(str))
    {
        try
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.LoadXml(str);
            return true;
        }
        catch {}
    }
    return false;
}

Also, from my blog post mentioned above, you can download the console app I developed and used against our problem sp application. I hope this will be useful.


In fact there was a Workflow for Disposition Approval attached to the Element Content type, not shure who placed it there, but anyways the Tasks could be found at the List. The Workflow was nerly invisible to me. The Error is odd and something I didnt expected

Lars

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜