Skip to main content
Nintex Community Menu Bar

Datafield not found

  • May 17, 2006
  • 3 replies
  • 25 views

Forum|alt.badge.img+1
I am getting this message in the K2.net 2003 Service Manager under errors, after I added a datafield to one of the process and do tests in the line from one event to another. The problem is that there is still old processes that must be completed and I must take this live for a request I am bussy with.

Can someone tell me what code can I use to test if the datafield exist before I set the field to a object

3 replies

Forum|alt.badge.img+4
  • May 18, 2006
hi Stefaans,

are you aware that if you export a new version of your process, then any already existing process instances will continue to use the old version & only new instances will use your new process?

You could loop through the K2.ProcessInstanceDatafields collection & check the name of each to see if the one you are expecting exists before populating?

Forum|alt.badge.img+3
  • July 12, 2006
Wez_p

Do you have any sample code for looping through the K2.ProcessInstanceDatafields collection & check the name to see if it exist?

Forum|alt.badge.img+4
  • July 14, 2006
icon-quote.giflchoing:
Wez_p

Do you have any sample code for looping through the K2.ProcessInstanceDatafields collection & check the name to see if it exist?


we're actually looping through a property bag that we produced & then seeing if that exists in the K2 process datafields before attempting to populate it. something like this:

.GetType());
}
}

// finish the work item
clientTask.Finish();

//close the K2 connection
workflowConnection.Close();


EDIT: a quick search in the K2 help files for "datafields class" also came up with this:


foreach(SourceCode.K2ROM.DataField oDataField in oDataFields)
{
if(oDataField.Name == "MyDataFieldName")
{
oDataField.Value = "My New DataField Value";
strMetaData = oDataField.Value.ToString();
}
}


hope that helps,

Wes