In our previous tip on workflows, we explored the initial stage of creating a workflow. We looked at how to gather some basic information for the workflow as well as how to determine its initiation. Now let’s go one step further—it’s finally time to create and build a functioning workflow!

Our Case Study

Suppose that multiple individuals in your company have the ability to update vendor information. This capability provides efficiency, but it also introduces a greater possibility for errors. In order to keep the supervisor informed about any vendor changes, we can create a workflow that will automatically alert the supervisor whenever a vendor record is updated.

Define Your Workflow

First, navigate to the new workflows page (Customization > Workflow > Workflows > New) and fill out the initial information. We’ll call our workflow “Test Vendor Email” and provide a comparable ID. Select “Vendor” as the Record Type and write a brief description of what your workflow will accomplish. Make sure that the Release Status is set to “Testing,” that Keep Instance and History is set to “Always,” and that Enable Logging is checked.

Then, determine the initiation of your workflow. Make sure your workflow is Event Based, with the On View or Update box checked. Because this workflow is fairly simple, you will not need to change anything else in this section.

After you’ve ensured that you have everything set on this page, click Save to go to the workflow builder.

The Three Musketeers of Workflows

In the workflow builder, you need to be aware of three crucial items: states, actions, and transitions. Your workflow will live or die by these three things—so understanding how they work is certainly important! First, you have states. These are represented by the boxes on your screen, and you can add as many as you need by simply clicking the New State button in the top left corner. Think of the states as visual representations of what is going on behind the scenes of your workflow.

Second, you have actions. While states provide the visual representation of each step in the process of your workflow, actions provide the actual . . . well . . . action. If you don’t insert an action into your states, your workflow won’t do anything. Actions, then, are at the very heart of what makes your workflow work.

And finally, you have transitions. Transitions are wonderfully self-explanatory. Represented by lines manually inserted between states, transitions move the workflow from state to state, telling the workflow in what order the various states and actions ought to be executed. They basically answer the question “What now?” after each state. A successful workflow will strategically utilize all three of these tools—states, actions, and transitions—to accomplish its purpose.

Build Your Workflow

For our sample workflow, we will need only one state, one action, and no transitions (since, after all, there’s only one state and you have nothing to transition to after that state is complete). Follow these steps as you edit and define your state:

  • Select State 1, which has already been supplied for you.
  • Click on the edit pencil icon to the right of your screen.
  • Name the state. For our example, I named the state “Test Vendor Update Email.”
  • Make sure that the Start State box has been checked.
  • Click Save.

Now you are ready to add an action to this state. Follow these steps:

  • Make sure the state is selected.
  • Click on New Action at the lower right-hand corner of the screen.
  • Choose Send Email as your action.
  • Select After Record Submit for the Trigger On field.
  • Select Edit as your Event Type.
  • Choose a specific sender (such as the administrator).
  • Select Specific Recipient and choose the individual who needs to receive the email.
  • Under Content, select Custom and type up a brief explanatory message.
  • Be sure to check the Include View Record Link box to provide a quick transition straight from the recipient’s email inbox back into the relevant record.
  • Click Save.

And voila! Your simple workflow is complete. You will notice that we didn’t use a number of fields at all in building this workflow. The abundance of options may be overwhelming at first, but as you grow more comfortable with workflows you will learn to hone in on the elements you need the most. And if you ever have a question about what a particular field does, remember that you can always click on each field name to view the field help box.

But Did It Work??

Before we dash away from our workflow, let’s make sure it is actually doing what it is supposed to do! Navigate to a Vendor record and edit/add something to it. For our example, I added Furniture, Inc. as a test vendor. I’m going to add a new phone number and then save the vendor record. If all goes well with our workflow, NetSuite will send the custom email we just created to the supervisor right after I save the updated record (hypothetically—remember we’re still in testing mode!).

After updating your record, go to the Communication subtab under your vendor record to make sure the system actually sent that email.

And there it is—proof that our workflow is functioning properly! You can also check under the subtab System Information for the Workflow History log for a complete list of times the workflow has run on this record. And once you’ve checked on the functionality of your workflow, don’t forget to change your workflow release status from Testing to Released.

Conclusion

We hope this blog has been helpful! For more blogs on workflows, see the related posts below. And be sure to subscribe to our mailing list so you can receive our latest NetSuite tips and tricks directly in your inbox.

Happy workflow building!