Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

SPFile.Publish changes Approval Status but workflow does not start

  Asked By: Joseph Petty         Date: May 30, 2008      Category: Sharepoint      Views: 1039
 

I have configured the Approval workflow for a Wiki list. The
workflow is set to "Start this workflow to approve publishing a major
version of an item.". Versioning is set to creat major and minor
versions.

When I manually "Publish a Major Version" for a wiki page the
workflow starts OK, but when I use a webpart with this code it does
not start:

SPFile myFile = SPContext.Current.File;
myFile.Publish("A comment");

What happens is SharePoint changes the Approval Status for the page
from "Draft" to "Pending" but does not start the workflow.

Is there something else I need to do to start the actual workflow
programmatically, please?

Tagged:                    

 

2 Answers Found

 
Answer #1       Answered By: Daamodar Bhadranavar          Answered On: May 30, 2008       

I haven't done this before, but usually you need to call the Update
method on SP objects that have been changed. SPFile does have an Update
method, so give it a try.

 
Answer #2       Answered By: Destiny Lewis          Answered On: May 30, 2008       

Dont take this as gospel, but for some reason I think after SP1 that
if you are signed in as a "system account" that workflows will not
automatically fire.

 


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].