Workflow advance to next step after form save

Charles Matvchuk asked on April 12, 2015 10:57

I am having a time of getting this to work.

I have a contribution web part on a page for a logged on user to use on the LIVE site. Works like a charm. I need to put the new document into a review workflow status, which I have an advanced workflow and it works fine manually. So that the new document automatically shows up on someones pending pages tab, I believe the only way I can do this is to advance the workflow via code. Unless I missed something.

I am in the ContributionList.ascx web control and I am handling the void CMSForm_OnAfterSave. Problem is, I cannot seem to get an instance of the newly inserted document (Page) which is a child of the page the contribution web part is on. If I was just coding from scratch I would execute scalar or pick up the new ID from entity framework class to pass it to the correct method. Easy, and takes a few minutes.

I have been on this now for a couple of hours to no avail. Any ideas or preferably a code example would be much appreciated.

   Please, sign in to be able to submit a new answer.