21 Sep 2011

Workflow Forms SharePoint

 

A. Custom .ASPX forms

You can use the same workflow solution with both Microsoft SharePoint Foundation 2010
and Microsoft SharePoint Server 2010

B. Microsoft InfoPath 2010

It don’t support SharePoint Foundation 2010

Forms

 

Association Form

Association form provides the default configuration parameters for automatic startup

Initiation Form

The initiation form targets end users and is presented to them when they manually start a workflow instance.

Modification form

Modification form is useful when you need to change the configuration of a workflow
instance that is already running

image
Sequential workflow with custom approval

 

It will be presented to the administrative users while associating the workflow with its target list or Content Type.


C# code behind the out-of-the-box association form page

   1:  public partial class OffersApprovalAssociationForm : LayoutsPageBase {
   2:  // Private fields declaration omitted for the sake of simplicity
   3:  protected void Page_Load(object sender, EventArgs e) {
   4:  InitializeParams();
   5:  }
   6:  private void PopulateFormFields(SPWorkflowAssociation existingAssociation) {
   7:  // Optionally, add code here to pre-populate your form fields.
   8:  }
   9:  // This method is called when the user clicks
  10:  // the button to associate the workflow.
  11:  private string GetAssociationData() {
  12:  // TODO: Return a string that contains the association data that
  13:  // will be passed to the workflow. Typically, this is in XML format.
  14:  return string.Empty;
  15:  }
  16:  protected void AssociateWorkflow_Click(object sender, EventArgs e) {
  17:  // Optionally, add code here to perform additional steps
  18:  // before associating your workflow
  19:  try {
  20:  CreateTaskList();
  21:  CreateHistoryList();
  22:  HandleAssociateWorkflow();
  23:  SPUtility.Redirect("WrkSetng.aspx", SPRedirectFlags.RelativeToLayoutsPage,
  24:  HttpContext.Current, Page.ClientQueryString);
  25:  }
  26:  catch (Exception ex) {
  27:  SPUtility.TransferToErrorPage(String.Format(
  28:  CultureInfo.CurrentCulture, workflowAssociationFailed, ex.Message));
  29:  }
  30:  }
  31:  protected void Cancel_Click(object sender, EventArgs e) {
  32:  SPUtility.Redirect("WrkSetng.aspx", SPRedirectFlags.RelativeToLayoutsPage,
  33:  HttpContext.Current, Page.ClientQueryString);
  34:  }
  35:  
  36:  }




Workflow Task Forms


Every time a workflow needs to query its users, it assigns them a task.


Workflow Task provides a standard user interface as well as standard fields,
such as Predecessors, Priority, Status, % Complete, and so on. In a real workflow solution, you
probably need to prompt end users with a custom user interface and with custom fields.



  1. Display Form

  2. Edit Form

No comments:

Post a Comment