i have function like this
private void k2action(int action)
{
try
{
oConn = new WF.Connection();
oConn.Open(ConfigurationManager.AppSettings["K2Server"], string.Format("{0},{1},{2}",
ConfigurationManager.AppSettings["domain"], ConfigurationManager.AppSettings["username"],
ConfigurationManager.AppSettings["password"]));
WF.WorklistItem wfItem = oConn.OpenWorklistItem(Request.Params["sn"],"ASP");
oConn.ImpersonateUser(user);
wfItem.Actions[action].Execute();
}
finally
{
if (oConn != null)
oConn.Close();
}
}
it get an error in wfItem.Actions[action].Execute(); and it say it was null and Object reference not set to an instance of an object.
can anyone help me here??
when i debug it and check the worklist item, the folio and serial number is correct when i check it but the action count is 0
oyeah i can approve it via k2 workspace though
thx