0

I have an edit item form on a list in SharePoint Designer 2010 and I want to run a specific list workflow (not site workflow) when clicked this button. How can I do this? If this is not possible, how can I set the value of a list item when form action button clicked? I have a workflow which is using a column value in if statements. If I set the value of that column when button clicked, I can use this workflow when list item updated.

enter image description here

Thanks in advance.

  • "when clicked this button" which button are you referring to? – MdMazzotti Jan 30 '14 at 13:26
  • I'm using a form action button with "Commit" action. Added screen shot. – newbie Jan 30 '14 at 13:29
  • You're attaching the standard commit action to a custom button then. In this case, just attach a workflow to your list and set it to start automatically whenever an item is edited – MdMazzotti Jan 30 '14 at 13:31
  • I did this. But I'm using a column value as a parameter in this workflow. Like, if flag=1 then send email to all users, if flag=2 then send email to only current user. I want to set this "flag" value only if this button clicked. – newbie Jan 30 '14 at 13:34
  • This is still unclear to me. If this is the only commit button present in the edit form, then it will always be clicked (unless the user clicks on cancel). Meaning that the flag can be set to a constant value. Am I missing something? – MdMazzotti Jan 30 '14 at 13:37
1

You said you have a FLAG column in your list and that you have multiple edit forms and you are looking for a way to discern which edit form actually caused the editing.

You can achieve your goal by adding a <asp:HiddenField> to each edit form, and setting its Value to the value you want the flag to have.

<asp:HiddenField runat="server" id="hidFlag" Value="108" __designer:bind="{ddwrt:DataBind('u','hidFlag','Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Flag')}"/>

Pay attention to the ddwrt:DataBind syntax. For more information about its usage, see this blog post.

  • Thank you for your response. But I solved my problem passing ListItemId parameter through a site workflow. If there is any problem, I will try this and write comments. – newbie Feb 4 '14 at 14:10
0

You can add the [Custom action] in your picture above. What this will do is create a workflow associated with your form.

If there are any fields on your form formatted as "Label," then you can use those form fields in the workflow. There, you should be able to set a value for your list item. You'll have to have some way of locating it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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