locked
list submit button that goes to a specified workflow RRS feed

  • Question

  • I want to start a workflow when a user hits a submit button on a list form but all my current button is doing is saving the existing form? Any way to change the redirect and include the ID required for the workflow?

    Many thanks,

    S

    Monday, June 18, 2012 8:15 AM

Answers

  • Hi StephenMD,

    If you want the list submit button that goes to a specified workflow, you will overwrite the button. So, you can use SharePoint designer custom yourself button.

    1. Open your NewForm.aspx or EditForm.aspx with SharePoint designer 2007.
    2. Find the List Form Web Part, delete the original.
    3.  Insert->SharePoint Controls->List Form->choose your list and type.
    4. Then you will find the button is on the page. You can custom your button.

    You can also use program to do it , you can refer to the following link.

    http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/3b5695e5-904d-4f42-9e05-afeb4ab2cc96

    Thanks,

    Jack

    Wednesday, June 20, 2012 9:34 AM
    Moderator

All replies

  • Hi StephenMD,

    If you want the list submit button that goes to a specified workflow, you will overwrite the button. So, you can use SharePoint designer custom yourself button.

    1. Open your NewForm.aspx or EditForm.aspx with SharePoint designer 2007.
    2. Find the List Form Web Part, delete the original.
    3.  Insert->SharePoint Controls->List Form->choose your list and type.
    4. Then you will find the button is on the page. You can custom your button.

    You can also use program to do it , you can refer to the following link.

    http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/3b5695e5-904d-4f42-9e05-afeb4ab2cc96

    Thanks,

    Jack

    Wednesday, June 20, 2012 9:34 AM
    Moderator
  • thanks Jack, I've seen this a lot...

    public class CustomSaveButton : SaveButton
        {
            Button btnSave;
            
            protected override void OnInit(EventArgs e)
            {
                base.OnInit(e);
            }

            protected override void OnLoad(EventArgs e)
            {
                base.OnLoad(e);
                btnSave = (Button)TemplateContainer.FindControl("diidIOSaveItem");

                if (this.ControlMode == SPControlMode.Edit)
                {
                    if (this.ListItem["CCRFIdUrl"] != null)
                    {
                        btnSave.Text = "OK";
                    }
                }
            }

           

            protected override bool SaveItem()
            {
                bool bValue  = base.SaveItem();
                return bValue;
            }

          
        }

    But i dont quite understand as this looks like code behind but when i look at my files i dont see these the code behind files...only the ASPX?

    S


    Friday, June 29, 2012 8:46 AM