I'm creating a Sequential Workflow on a CustomList in viualstudio 2010.
My problem is: when I publish the workflow, the list forms (for NewItem, EditItem and so on) get changed and now just contain the title field. My custom fields like "administrator" and so on disapeared.
What I've done to create the WF:
1. Starting VS 2010
2. New Project
3. Sequential WF
4. deploy as farm solution
5. List WF
6. Checked yes: associate with the following libraries/Lists...: myList, associate wf with: myWF, HistoryList: Workflow History, Task lsit:
tasks
7. The wf starts automatically when Item is created
It should looks like: https://i.sstatic.net/SXIvU.png
After adding the WF it looks like that: https://i.sstatic.net/NcVQo.png
Thanks a lot!
Edit: I've didn't add CustomActions or Buttons, the workflow starts after creating a item,
I've tried different things: deploying the workflow witout any steps (expecting the start and end), I've tried to send a mail, I've tried to write into the log...alway the same result, the fields disappear"
I'm owner of the List with full rights
I'm thinking about: if it is possible that the problem results from Association to the List. Now the workflows elements.xml looks like that:
<?xml version="1.0" encoding="utf-8" ?>
<!-- Customize the text in square brackets.
Remove brackets when filling in, e.g.
Name="[NAME]" ==> Name="MyWorkflow" -->
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Workflow
Name="ApproveRessources - Workflow"
Description="My SharePoint Workflow"
Id="b80b5e1d-67ff-40c0-961a-e1586d6a24c0"
CodeBesideClass="ApproveRessources.Workflow1.Workflow1"
CodeBesideAssembly="$assemblyname$">
<Categories/>
<MetaData>
<AssociationCategories>List</AssociationCategories>
<!-- Tags to specify InfoPath forms for the workflow; delete tags for forms that you do not have -->
<!--<Association_FormURN>[URN FOR ASSOCIATION FORM]</Association_FormURN>
<Instantiation_FormURN>[URN FOR INSTANTIATION FORM]</Instantiation_FormURN>
<Task0_FormURN>[URN FOR TASK (type 0) FORM]</Task0_FormURN>
<Task1_FormURN>[URN FOR TASK (type 1) FORM]</Task1_FormURN>-->
<!-- Modification forms: create a unique guid for each modification form -->
<!--<Modification_[UNIQUE GUID]_FormURN>[URN FOR MODIFICATION FORM]</Modification_[UNIQUE GUID]_FormURN>
<Modification_[UNIQUE GUID]_Name>[NAME OF MODIFICATION TO BE DISPLAYED AS A LINK ON WORKFLOW STATUS PAGE</Modification_[UNIQUE GUID]_Name>
-->
<StatusPageUrl>_layouts/WrkStat.aspx</StatusPageUrl>
</MetaData>
</Workflow>
</Elements>
The List is a CustomList.
I've deployed by right clicking the project and deploy and tried to debug via F5 too.
Code behind:
public sealed partial class Workflow1 : SequentialWorkflowActivity
{
public Workflow1()
{
InitializeComponent();
}
public Guid workflowId = default(System.Guid);
public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();
}
My Listdefinition:
<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint"
ModeratedList="TRUE" ModerationType="TRUE" VersioningEnabled="TRUE" Title="Resourcen" FolderCreation="FALSE" DisableAttachments="TRUE" Direction="$Resources:Direction;" Url="Lists/Resourcen-ListDefinition1" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
<MetaData>
<ContentTypes>
<ContentType ID="0x01" >
<Folder TargetName="Item"/>
<FieldRefs>
<FieldRef ID="{B3576739-CF3E-4519-8B86-EA7C9566BB9F}" Name="ContentType" />
<FieldRef ID="{E8848239-E1C9-441a-870C-6BC67E05F634}" Name="Prefix" Required="TRUE" ShowInNewForm="TRUE" />
<FieldRef ID="{E71ECD30-4901-4a29-9114-953276F08116}" Name="Title" Required="TRUE" ShowInNewForm="TRUE" ShowInEditForm="TRUE" />
<FieldRef ID="{096E8489-7EE6-4e3d-BB3D-A4A4712203CC}" Name="Administrator" Required="TRUE" ShowInNewForm="TRUE" ShowInEditForm="TRUE" />
<FieldRef ID="{1F592C34-377F-4b8d-B4BE-0BC0C6794BE9}" Name="Vertreter" Required="TRUE" ShowInNewForm="TRUE" ShowInEditForm="TRUE" />
<FieldRef ID="{C011FE90-85D6-4790-93F9-58F3CAB1EBA9}" Name="ExpiresDate" Required="FALSE" ShowInNewForm="FALSE" ShowInEditForm="FALSE" />
</FieldRefs>
<XmlDocuments>
<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
<FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
<Display>ListForm</Display>
<Edit>ListForm</Edit>
<New>ListForm</New>
</FormTemplates>
</XmlDocument>
</XmlDocuments>
</ContentType>
<ContentTypeRef ID="0x0120" />
</ContentTypes>
<Fields>
<Field ID="{E8848239-E1C9-441a-870C-6BC67E05F634}"
DisplayName="Prefix" Name="Prefix"
Type="Choice" Required="FALSE"
UnlimitedLengthInDocumentLibrary="FALSE"
RowOrdinal="0">
<CHOICES>
<CHOICE>12</CHOICE>
<CHOICE>21</CHOICE>
<CHOICE>33</CHOICE>
</CHOICES>
</Field>
<Field ID="{096E8489-7EE6-4e3d-BB3D-A4A4712203CC}"
DisplayName="Administrator" Name="Administrator"
Type="User" Required="TRUE"
UnlimitedLengthInDocumentLibrary="FALSE"
Description="Der Resourcenverwalter"/>
<Field ID="{1F592C34-377F-4b8d-B4BE-0BC0C6794BE9}"
DisplayName="Vertreter" Name="Vertreter"
Type="User" Required="TRUE"
UnlimitedLengthInDocumentLibrary="FALSE"
Description="Der Resourcenverwalter"/>
<Field ID="{C011FE90-85D6-4790-93F9-58F3CAB1EBA9}"
DisplayName="ExpiresDate" Name="ExpiresDate"
Type="DateTime" Required="False"
UnlimitedLengthInDocumentLibrary="FALSE"
/>
</Fields>
<Views>
<View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ViewFields>
<FieldRef Name="LinkTitleNoMenu"></FieldRef>
</ViewFields>
<Query>
<Where>
<Or>
<Eq>
<FieldRef Name="Administrator" />
<Value Type="User">
<UserID />
</Value>
</Eq>
<Eq>
<FieldRef Name="Vertreter" />
<Value Type="User">
<UserID />
</Value>
</Eq>
</Or>
</Where>
<OrderBy>
<FieldRef Name="ExpiresDate" Ascending="True" />
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
</ParameterBindings>
</View>
<View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ViewFields>
<FieldRef Name="Attachments"></FieldRef>
<FieldRef Name="LinkTitle"></FieldRef>
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="ID"></FieldRef>
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
</ParameterBindings>
</View>
</Views>
<Forms>
<Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
</Forms>
</MetaData>
</List>
I've replaced the list several times. After deploying the list, the forms are working fine but the WF does not. After deploying the WF the WF works fine but the list-form-fields diappeare. Perhabs there is anything the WF overwrites?
If I use the workflow for an other List (no custom List) like a task list, every thing is working fine.
public Workflow()
. BEcause usually there all actions take place, the Elements.xml is not needed for that.