Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

trying to undeclare a sharepoint 2010 record programatically failing (also fails in UI)

$
0
0

hi i'm trying to undeclare a record in a workflow with the method Records.UndeclareItemAsRecord(SPListItem)

in general this works, however sometimes I get the error trace back (see below)

It seems like this happens when my record gets into a "bad state" (I'm not sure how this happens.

The "bad state" that I'm referring to is a record that shows in the UI as a record but is actually not checked out to the System account.  In the UI if you try to undeclare the record (via the compliance detals tab), when you click undeclare it, the sharepoint UI (Compliance Details screen) flashes a "processing request" message for a second and then the record status goes back to "Record".  It seems like the UI can't undeclare it either!

I had this problem before i started doing any vs 2010 workflows in a library and i called support to try and figure out how to delete this "bad state" record and they couldn't figure out a way to delete it.  Has anyone else had this problem?

 

error trace when debugging in visual studio 2010

Microsoft.SharePoint.SPInvalidPropertyException was unhandled by user code
  Message=Specified data type does not match the current data type of the property.
  Source=Microsoft.SharePoint
  ErrorCode=-2146232832
  PropertyName=_dlc_ItemStageId
  StackTrace:
       at Microsoft.SharePoint.Utilities.SPUtility.UpdateArrayFromHashtable(Object& o, Hashtable ht)
       at Microsoft.SharePoint.SPListItem.PrepareItemForUpdate(SPWeb web, Boolean bMigration, Boolean& bAdd, Boolean& bPublish, Object& objAttachmentNames, Object& objAttachmentContents, Int32& parentFolderId)
       at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents, String filename)
       at Microsoft.SharePoint.SPListItem.SystemUpdate()
       at Microsoft.Office.RecordsManagement.RecordsRepository.Records.<>c__DisplayClass24.<UndeclareItemAsRecord>b__21(SPSite site, SPWeb web, Boolean isNewUserToken)
       at Microsoft.SharePoint.Publishing.CommonUtilities.<>c__DisplayClass7.<RunWithElevatedSiteAndWebEx>b__4()
       at Microsoft.SharePoint.Publishing.CmsSecurityUtilities.<>c__DisplayClass1.<RunWithAllowUnsafeUpdates>b__0()
       at Microsoft.Office.Server.Utilities.Security.SecurityUtilities.RunWithAllowUnsafeUpdates(SPWeb web, Action secureCode)
       at Microsoft.SharePoint.Publishing.CmsSecurityUtilities.RunWithAllowUnsafeUpdates(SPWeb web, CodeToRun secureCode)
       at Microsoft.SharePoint.Publishing.CommonUtilities.RunWithElevatedSiteAndWebEx(SPSite siteNonElev, SPWeb webNonElev, Boolean allowUnsafeUpdates, Boolean isImpersonationStateCheckBypassed, ElevatedSiteAndWebProcessor callWithElevatedSiteAndWeb)
       at Microsoft.Office.RecordsManagement.RecordsRepository.Records.UndeclareItemAsRecord(SPListItem item)
       at TRACDispositionWF1.DispositionWorkflow1.DispositionWorkflow1.codeActivity2_ExecuteCode(Object sender, EventArgs e)
       at System.Workflow.ComponentModel.Activity.RaiseEvent(DependencyProperty dependencyEvent, Object sender, EventArgs e)
       at System.Workflow.Activities.CodeActivity.Execute(ActivityExecutionContext executionContext)
       at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
       at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
       at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
  InnerException:

 


krd

Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>