shadesofjay

Does anyone know how to specify a specific view in an InfoPath form to be used as a task form configured in workflow.xml Is this a setting or is some code involved

For example, the OOB's Approval workflow's xml has the following:

<Task0_FormURN>urnTongue Tiedchemas-microsoft-comSurpriseffice:infopath:workflow:ReviewRouting-ReviewEmbarrassedSubst:LCID;</Task0_FormURN>
<Task1_FormURN>urnTongue Tiedchemas-microsoft-comSurpriseffice:infopath:workflow:ReviewRouting-ReviewEmbarrassedSubst:LCID;</Task1_FormURN>
<Task2_FormURN>urnTongue Tiedchemas-microsoft-comSurpriseffice:infopath:workflow:ReviewRouting-ReviewEmbarrassedSubst:LCID;</Task2_FormURN>

In other words, there are 3 task forms associated with the wokflow and they all use the same form. However, if you open that form in InfoPath, it has different views, and if you open the task in SharePoint, you get one of the views.

I'm trying to understand how this is accomplished.

-Jay



Re: SharePoint - Workflow setting infopath views in workflow

Praveen battula

hi shadesofjay,

i understood ,but small confusion, what are these views

r u not getting same form in both (sharepoint and infopath)

say some clear way
thanks







Re: SharePoint - Workflow setting infopath views in workflow

shadesofjay

The views are defined in InfoPath, a feature of the program.



Re: SharePoint - Workflow setting infopath views in workflow

cksturton

Can you add a hidden field to the InfoPath form (e.g. 'TaskNumber') and then use ItemMetadata.xml to pass a value to that field (set the value in the CreateTask method). You can then have the form open to the correct view based on the value in that field. I haven't tried this, but I think it would work.

One thing I don't understand is why the OOB workflow has the form listed three times in the workflow.xml file. Why not just list it once and set the TaskType property for every task equal to '0'

-Cynthia





Re: SharePoint - Workflow setting infopath views in workflow

shadesofjay

Thanks Cynthia, I figured that out. As to your question, I have no idea.



Re: SharePoint - Workflow setting infopath views in workflow

Praveen battula

hi shadesofjay,

nice to hear u got solution, cynthia telling you that for all tasks you are using same form right

so no need to declare 3 taskform syntax in workflow.xml file. ex: <Task0_FormURN>,<Task1_FormURN> etc.....

if all forms are same, then set for each task creation method like

this.taskProperties1.TaskType=0;
this.taskProperties2.TaskType=0;
this.taskProperties3.TaskType=0;

it calls the same form for each task creation in workflow

thanks.





Re: SharePoint - Workflow setting infopath views in workflow

Aaron A

I have a question though...

How would you insert a value into the field if the form you want the view changed on is the item your workflow is associated with, not a task in the workflow I have tried promoting the field, but I cannot get the workflow to write a value into that column/field.





Re: SharePoint - Workflow setting infopath views in workflow

cksturton

Aaron,

I don't know the answer, but as a work around you could always write the value to a SharePoint list and then access that list data from IP (as a secondary data source) and change views accordingly.

Sorry I can't be of more help.

-Cynthia





Re: SharePoint - Workflow setting infopath views in workflow

Aaron A

We've decided to make the form check the current sharepoint user viewing the form. Seems to be the easiest solution so far, may not be right for other people's particular situation, but it will work for our purposes.



Re: SharePoint - Workflow setting infopath views in workflow

Aaron A

We have found something a lot easier than using a hidden field....setup user roles on the IP form, and depending on who is viewing the form, that is the view they get. It's VERY simple. I know that kind of gets out of the workflow part of this, but since this post was originally regarding a task form, this may still pertain.



Re: SharePoint - Workflow setting infopath views in workflow

softwarez

The problem with Aaron's suggestion is that user roles will not work in infopath form services (web-forms) as they are not supported.



Re: SharePoint - Workflow setting infopath views in workflow

Aaron A

I am not familiar enough with the forms server, so that is news to me. I did know there were limitations to the forms server, and we've already hit those limitations, so I guess that's why using roles is not a problem for us, since we're forcing the form to be opened in InfoPath anyway (not my preference, but not my call).

What can be done is that the form can pull the workflow status from the list column data and set the view depending on what the status is. And you can set custom workflow status's to meet your needs.





Re: SharePoint - Workflow setting infopath views in workflow

HANK1

Hi guys!

I use ItemMetadata.xml in my IP form which has three views. In the workflow a set value to the column in the task list like

Task.ExtendedProperty["WFTaskNumber"] and when I check in the taks list there is the Task number but when I open the form in the same task the value does not show up un the fiel. The field uses the secondary datasource and a formula. The formula take the value from the ItemMetadata.xml soource call WFTaskNumber. The column in the task list is WFTaskNumber. Does someone know what the problem is

Thank you

HANK