Skip to main content

Visual Workflow

The benefits of Visual Workflow
There are certain benefits of using Visual Workflow. They are as follows:
  • It allows you to create an automated business process using click not code.
  • Visual Workflow does not require coding, and even if you do not know Apex code you can still develop business processes.
  • Using screens, fields, and choices, you can implement complex business processes to make sure that your users are entering data in the right format.
  • Through Visual Workflow, you can manipulate data for certain objects that are not available for the Workflow rule. For example, when a "contact role" is created or updated as primary for an opportunity then create a new task.
  • It allows you to auto submit records for approval.
  • You can post messages on Chatter. For example, if opportunity status gets Closed Won, post a message on Chatter group.
  • It allows you to embed the Flow into the Visualforce page and using the Force.com Site you can expose it for unauthenticated access.
  • Once you embed your Flow into the Visualforce page, it allows you to use HTML, CSS, JavaScript, and other Visualforce components.
  • It can be easily maintained by non-developers.
  • Since it is not code, you don't need to write test classes.
  • You can make changes directly to your production organization, just like other configuration changes.
  • Every time unhandled processes fail or an error occurs in the Flow, the author will get an e-mail from Salesforce with the error details.
  • Using the debug log you can debug your Flow. Visual Workflow also has a built-in debugging tool. To open the debug window, press Ctrl + Shift + M (on PC) or command + shift + M (on Mac).
  • It allows you to invoke the Apex class that implements the Process.Plugin interface.

An overview of the Visual Workflow life cycle

The Cloud Flow Designer is a tool to create Flows, configure screens, and define business logic for your Flows without writing a single line of code. Visual Workflow has three different parts, these are as follows:
  • Design: This allows you to create the Flows using the Flow Designer, which has a drag and drop user interface that allows you to draw the Flow structure and configure how it runs, without writing a single line of code.
  • Administration: Once you have created a Flow, you can manage it, edit its properties, activate, deactivate, delete, save as a new version or new Flow, or run it as well.
  • Runtime: A Flow user can run the active Flow from a custom button, link, Visualforce page or directly from the Flow URL. If it is autolaunch Flow, then systems can run active Flows through Process Builder or an Apex class.

The various ways to invoke a Flow

As soon as you are done with Flow development, the next task is to configure Flow access for business users, so they can use it. There are various ways through which you can invoke/launch your Flows. They are as follows:
  • The Flow URL
  • A custom button or URL
  • A web or Visualforce tab
  • A combination of the Visualforce page and the Force.com Site or customer portal and partner portal
  • The Login Flow
  • The Visualforce page
  • Process Builder
  • The Apex start() method
  • The Invocable Action resource in the Force.com REST API
Flow Types 
This is the type for the Flow or Flow version. The type will appear in the Flow detail and Flow management page. The following are different types of the Flow:
  • Flow: To execute this type of Flow, it requires human interaction because it may contain one or more screens, steps, choices, or dynamic choices. Flows don't support Wait elements.
  • Autolaunched Flow: This type of Flow doesn't require human interaction to start. It doesn't support screens, steps, choices, or dynamic choices. It can be launched through Process Builder action, inline Visualforce page, or Apex code.
  • User Provisioning Flow: This provisions users for third-party services. A user provisioning Flow can only be implemented by associating it with a connected app when running the user provisioning wizard. It also provisions users for third-party services. Contact thehttp://www.salesforce.com/ support to enable this for your organization.

A few points to remember

The following are some noteworthy points about the Flow design:
  1. As far as possible, use fewer elements in your Flow, so it will take less execution time.
  2. The limit on the number of executed elements at runtime is 2,000.
  3. One organization can have a maximum of 500 active Flows and processes.
  4. One organization can have a maximum of 1,000 Flows and processes.
  5. The date must be in the MM/DD/YYYY format while entering a date and the MM/DD/YYYY HH:SS format for date and time.
  6. The Flow will return null at runtime if you leave any field or resource value blank.
  7. For the text value if you want it to be treated as empty a string instead of null, then set it to{!$GlobalConstant.EmptyString}.
  8. At runtime, the date/time values reflect the time zone settings in Salesforce. For the running users and in the Flow designer, date/time values reflect the time zone set on your computer.
  9. UTF-8 encoding for text in user input fields is not supported by Cloud Flow Designer.
  10. If you entered null as the default value for a text field in the Flow Designer, it will clear the default value after saving.
The following are some noteworthy points regarding data manipulation in Flow:
  1. If the Flow doesn't have a start point then you will not get an active link on the Flow Detail page.
  2. You have a maximum of 50 versions in a Flow.
  3. Use the ID of the record type in a Flow to set the record type for a record.
  4. It's not possible to redirect Flow users to a URL that is outside your Salesforce organization.
  5. Make sure that the variable is set as Input and Output to pass values from the URL.
  6. In the send e-mail static action, it's allowed to use Email Addresses (comma-separated) or Email Addresses (collection), but the limit is a combined number of addresses of five or less.
  7. You can use string values in Email Addresses (comma-separated).
  8. Use Text Template for formatted e-mail alerts. The Text Template allows HTML tags.
  9. If you have used the Record Delete element to delete records, it can delete records that are between an approval process.
  10. In the Decision element, you can use the contains operator with collections to identify if it contains a particular value.
  11. If you haven't activated the "Enable governor limits on all executed flows" critical update, Flow can only update or delete a maximum of 200 records.
  12. Once you have enabled the "Enable governor limits on all executed flows", Flows can process a maximum of 10,000 records as a part of DML operations.
  13. The maximum number of SOQL queries issued in one transaction is 100.

Comments

Popular posts from this blog

VisualForce Best Practices

Accessing component IDs When we refer Visualforce  components in JavaScript, the ID attribute plays a major role. Every Visualforce component has an ID attribute. The ID attribute must be specified to a particular component in order to refer to it in JavaScript and it is used to bind the two components together. When the page is rendered, this ID attribute is a part of DOM ID of the particular component. The ID attribute must be unique as well. The following best practices are applied for accessing component IDs: Use the  $Component  global variable  to simplify access. For an example, when we have an input field with  id="inputOne"  within a page block with  id="blockOne" , we can access the input field with the $Component.blockOne.inputOne  expression. No need to  specify an ID for a component you want to access if it is an ancestor or sibling to the $Component  variable in the Visualforce component's hierarchy. ...

Visualforce fundamentals

Visualforce  is a web development framework that enables developers to build sophisticated, custom user interfaces for mobile and desktop apps that can be hosted on the  Force.com  platform. You can use  Visualforce  to build apps with user interfaces that look like the standard interface provided by  Force.com , as well as your own completely custom interface. Visualforce  enables developers to extend  Salesforce ’s built-in features, replace them with new functionality, and build completely new apps. Use powerful built-in standard controller features, or write your own custom business logic in  Apex . You can build functionality for your own organization, or create apps for sale in the  AppExchange . Visualforce  app development is familiar to anyone who has built web apps. Developers create  Visualforce  pages by composing components, HTML, and optional styling elements.  Visualforce  can integrate with ...