InfoPath task form won't fire OnTaskChangedEvent - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

InfoPath task form won't fire OnTaskChangedEvent

Last post 12-11-2009 06:58 PM by Catherine. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 08-28-2009 08:12 PM

    InfoPath task form won't fire OnTaskChangedEvent

    I know for a fact that I've created IP task edit forms before and clicked on their Submit buttons and stopped on a breakpoint in an OnTaskChanged event, but for the life of me, I can't get it to work now.

     I have a VS2008 sequential workflow with a very simple CreateTask->While->OnTaskChanged->CompleteTask mechanism. My IP form both submits and receives data (via ItemMetadata.xml) and a simple submit data connection.

    I've check the TaskContentTypeID, task numbers,URNs, workflow.xml, feature.xml and so on.

    When my form appears, I see the data I put in there via my extended properties. When I click on the submit button, the ontaskchanged event does not get fired. Next time I open the form, all the data has been wiped clean.

     What am I missing here? This should work as far as I can tell unless I'm missing some small piece.

  • 08-29-2009 09:32 AM In reply to

    Re: InfoPath task form won't fire OnTaskChangedEvent

    Logic error, workflow was completing before the task had a chance to even be edited!



  • 11-06-2009 02:01 AM In reply to

    Re: InfoPath task form won't fire OnTaskChangedEvent

    I face the same problem here.

    I have an infopath task form with managed code (C#) behind it.  I submit the form to network location. 

    I put AfterProperties.ExtendedProperties[field name in infopath form].ToString() in onTaskChanged to get the value from the infopath task form submitted but it appears to have NullReferenceException.

     May i know what should i do?  I already try to retrieve the value by putting the field guid instead of using the field name but it failed

  • 11-07-2009 11:52 AM In reply to

    Re: InfoPath task form won't fire OnTaskChangedEvent

    That is what fixed the problem for me. I had to do something like:

     this.taskAfterProperties.ExtendedProperties[new Guid("....guid")].ToString();


  • 11-08-2009 06:14 PM In reply to

    Re: InfoPath task form won't fire OnTaskChangedEvent

    Hi.  I have tried with the method and it still failed. 

    The onTaskChanged is in my another activity which i then drag into the replicator activity in my workflow.  After i add the workflow into MOSS, I run and submit the task which is in progress. Suppose it would be completed and display the next assignee name.  But the status still display "In Progress" and error occurred for the worklfow.  I checked back the log file and find the error with null exeception reference : object reference not set to an instance of an object at workflow.onTaskChanged.

    I build one column (Result) in the document library where i store my absence request form which is controlled using content type.  When i try again with the workflow then same error occurred again. 

    There is one field in my task form named Result.  Suppose when i click the submit button the value in the "Result" field on the task form should be submitted to the document library but it didnt.  The task form is built using InfoPath 2007 with some C# behind it.

     I am searching for another method to retrieve the approved/rejected status from the task form submitted by user.  This problem has been bothered me for more than one week.  Any suggestion on the problem ?


  • 11-09-2009 03:26 AM In reply to

    Re: InfoPath task form won't fire OnTaskChangedEvent

    Have you actually debugged into the workflow and put a breakpoint in the onTaskChanged event to see that it is not getting hit?

    The only other thing I can think of (if the event is not getting fired) is that in your IP form, in the rules for your Submit button, you have somehow accidentally deleted the 'submit using a data connection' action. I've done that before accidentally whenever making changes to the data connection, I didn't realize it would remove it from the rule action.

  • 11-09-2009 09:46 PM In reply to

    Re: InfoPath task form won't fire OnTaskChangedEvent

    Hi.  I already tried to debug the workflow and checked the submit button contains "submit using a data connection" action or not.

    The submit button got the action of submit using data connection.  In debugging the workflow, there is an error which bother me for few weeks and i still failed to solve it.  It is system.nullexception.  Below is the message pop up during debugging:

    An exception of type 'System.NullReferenceException' occurred in ApprovalActivities.dll but was not handled in user code

    Additional information: Object reference not set to an instance of an object.

    I set my breakpoint at taskLeaveStatus in onTaskChanged:

    public string taskLeaveStatus;

    string guidField=taskGuidField.toString(); //Bring from workflow through replicator activity: (e.Activity as ManageApproval).taskGuidField=guidField.toString();

    taskLeaveStatus=this.AfterProperties.ExtendedProperties[new Guid(guidField)].toString(); //Breakpoint at here

    It shows me the error.  Last few times I tried using field name but it failed and same error occurred.

     So I wonder what is the error here as for the field it suppose contains the value bring from the IP task form.

    Thanks again.


  • 11-10-2009 03:46 AM In reply to

    Re: InfoPath task form won't fire OnTaskChangedEvent

    If it were me, I would install SharePoint Explorer from codeplex and dig into my content type to make sure my Guid is correct.  Is this a content type you created via the UI or is it a CAML based content type? If it's not CAML based then I suppose you are getting the guid value correctly.  Still though, I can't think of anything else that would be causing this.

  • 12-11-2009 06:58 PM In reply to

    Re: InfoPath task form won't fire OnTaskChangedEvent

    Hi. Sorry for late replying.

    Actually I'm still new to SharePoint.  About whether my content type is created via the UI or CAML, I actually don't know as I just follow some website tutorial in creating the task form.  Only that I got add some code programmatically to enable some function in the task form.

    However, thanks a lot for your help in giving me any possible suggestions in debugging the problem.  I will continue to search for any other alternative way to solve the problem.

     Have a nice day.


Page 1 of 1 (9 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.