Value cannot be null. Parameter name: replacement

  • 4 November 2008
  • 4 replies
  • 2 views

Badge +1

hi guys


i need help with this error in the subject line.


i get it whenever i try to update a worklist item from my web application.


here is the code im using, and has been working along. what could be the problem?


the exception is thrown by the line 'worklistItem.Update()"


Try


Dim

K2Server As String = System.Configuration.ConfigurationManager.AppSettings("K2Server")


Dim conn As New SourceCode.K2ROM.Connection


conn.Open(K2Server,

"[;];Authentication=Windows;Domain=DCS;User=xxx;Password=xxxx;")


Dim worklistItem As SourceCode.K2ROM.WorklistItem


worklistItem = conn.OpenWorklistItem(

Me.getSessionVariable("sn"), "ASP")


Dim procInst As SourceCode.K2ROM.ProcessInstance


procInst = worklistItem.ProcessInstance


procInst.DataFields.Item(

"FirstDestination").Value = procStatus


worklistItem.Update()


worklistItem.Finish()


conn.Close()


catch ex as exception


End try


4 replies

Badge +9

Ok two things here:



  1. The Finish() call would update the data fields and also complete the workitem.  So you wouldn't need to do an Update() call before the Finish call.
  2. From the error message, it sounds like there is a parameter called replacement and it is expecting a value.  Check your process and see where exactly this is definied and what the current value is.
Badge +13

I've gotten that error a year ago and it was misleading.   It didn't have anything to do with a field called replacement.   Search for: 

Parameter name: replacement

There are past posts to indicate if workitem is in error state or stopped you'd get that.

Badge +9
Thanks Peter for the quick correction on that :)
Badge +2
thx johnny

Reply