I am trying to make my custom task form (of Visual Studio Sequential Workflow) to switch view to "Submitted" in case someone has already submitted this task before, since this task could be assigned to multiple people.

Target scenario: in case task has already been submitted by one user and another user is opening the form for this same task (by button from Outlook Task E-mail notification) user would see a message informing that task has already been submitted, by who and with which result.

I have designed a "Submitted" view for that purpose and now researching how to do the logic: either using Data tab > Rules > Form Load and set up actions there or using Developer > Loading Event and write it in code under FormEvents_Loading event in Visual Studio Tools for Applications.

I would prefer the VSTA option. Are there code examples of this (or something similar) being done available? I appreciate any hints you might have. Thanks.

  • If the task had not ever been submitted before, how can it possibly exist? How was it created? Commented Aug 13, 2012 at 17:15
  • Task is created by workflow, assigned to a group of people. Each group member receives E-mail notification about it. Then one of members of the group submits the information required by task (fills out and submits form). At that point someone else who also received this task notification, unaware that it was already submitted, attempts to open this task form (directly from Outlook, using Edit Task button, that is part of Task E-mail format). This is when I need the form to inform the guy that it has already been submitted and with following data, and at the same time to prevent another submit.
    – SviFi
    Commented Aug 13, 2012 at 19:07

2 Answers 2


You can make use of hidden fields inside infopath form. Add a hidden boolean field named "Submitted" in your form. Whenever user submit the form change the value of field to true. Next time when any user opens the form check what's value of hiiden field. If the value is true change the view to "Submitted View".


I am not sure how much sense is in checking something at opening (another guy could have opened a form a month ago) but in order to prevent overwriting you can try:

it is in VSTA

I cannot check it now, but I always thought that only the first opened instance of Infopath form is editable while all the following are being opened in read-only mode. Aslo, "When an InfoPath form is opened by a user, it is locked and only editable by that person."

Or, it is not correct?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.