Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
    
If the task had not ever been submitted before, how can it possibly exist? How was it created? –  Gennady Vanin Novosibirsk Aug 13 '12 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 Aug 13 '12 at 19:07
add comment

2 Answers

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

Update:
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?

share|improve this answer
add comment

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".

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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