Brenden
I have implemented the above code and i am not getting consistent results. I kno whte changes were made but for some reason this is happening . I'm not getting any errors in the logs.
if (!cbTest.Checked)
{
WorkflowManager workflowManager = WorkflowManager.GetInstance(_naisTree);
WorkflowInfo workflow = workflowManager.GetNodeWorkflow(article);
if (workflow != null){
if (!article.IsCheckedOut)
try{
article.CheckOut();
}catch(Exception ex){
EventLogProvider.LogEvent(EventType.ERROR, "Author Checkout ", "SWP", "ca't checkout " + ex.Message);
}
}
article.SetValue("Author", newAuthorRefference);
article.Update();
if (workflow != null){
try{
article.CheckIn();
}catch(Exception ex){
EventLogProvider.LogEvent(EventType.ERROR, "Author Checkin ", "SWP", "ca't checkin " + ex.Message);
}
}
if (workflow != null){
try{
article.Publish();
//article.Publish("updated via api");
}catch(Exception ex){
EventLogProvider.LogEvent(EventType.ERROR, "Author publish ", "SWP", "ca't publish " + ex.Message);
}
}
}
Any ideas?