2

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.

10
  • What do you mean with "changed"? Sounds like you want to say that they have no longer any icon? And 6. Checked with .. you mean lists, not libraries, right? You haven't mentioned, but did you defined new buttons aka CustomAction? But you can start your workflow as intended? Commented Feb 9, 2012 at 9:31
  • thanks for your pictures. Thats hm funny or ridiculous. So you have an approval workflow, right? And your WF is set to start a task to someone that has rights to approve changes? What happens, if you put your name into the requested field from wf (Name)? What steps did you declare in your wf? Can you start your wf manually? For debugging purpose it will help. Sorry for deleted comment, wanted to add, but was to late. Commented Feb 9, 2012 at 9:55
  • K, which rights do you have on this list? I have did what you did, starting an empty workflow on item create - but nothing unusual, I can fill all fields. Commented Feb 9, 2012 at 9:57
  • Thanks for update, but I don't think that it is based here. I had a lot of trouble with caching, so how do you deploy? Just pressing F5 or right-click and deploy? Commented Feb 9, 2012 at 10:17
  • can you please add also your wf code? the page where you have public Workflow(). BEcause usually there all actions take place, the Elements.xml is not needed for that. Commented Feb 9, 2012 at 10:28

2 Answers 2

1

I've got the solutions!

The content type definition was the problem. I had to define the fields insede of the content type. I just referenced them ;-)

Thanks a lot!

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Element (0x01) -->
  <Field ID="{E8848239-E1C9-441a-870C-6BC67E05F634}"
           DisplayName="Prefix" Name="Prefix"
           Type="Choice" Required="FALSE"
           UnlimitedLengthInDocumentLibrary="FALSE"
           RowOrdinal="0">
    <CHOICES>
      <CHOICE>7</CHOICE>
      <CHOICE>4</CHOICE>
      <CHOICE>1</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"
          />



  <ContentType ID="0x01009bc8ebf41f2940bc8a3ca4e2ea145601"
               Name="Resourcen - Ressource"
               Group="Custom Content Types"
               Description="My Content Type"
               Inherits="TRUE"
               Version="0">
    <FieldRefs>

      <FieldRef ID="{E8848239-E1C9-441a-870C-6BC67E05F634}" Name="Prefix" Required="TRUE" ShowInNewForm="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>
  </ContentType>
</Elements>
0

As a summary of ask & respond: It looks weird. An empty workflow changes the Add-Item-Form and asks for a person to approve. But this can be any, there is no check by PeoplePicker. Also the columns are changed to Name and Status, thus skipping all defined 5 columns. This doesn't happen if the list is defined step by step using SharePoint Designer or web interface with "same" column definitions.

So I assume that some part of the list definition causes this error, because the Edit-form is changed, but the list columns are still there, but ignoring anything if I try to do change settings.

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.