SharePoint Workflow Designer Tips P2

View other parts:

Use Comments

One of my favorites features in SharePoint Designer is the ability to add notes for you and others to later open the workflow code and understand what is happening.

You can add comments inside SharePoint Designer by adding an action called Add a Comment.

SharePoint Workflow Designer Tips P1 2322

It is always good practice to make sure to add comments that describes what you are doing inside your code.

Workflow Variables

When writing workflows using SharePoint Designer, you usually need to create many variables.

Make sure that all your variables have names that are descriptive. Adopt naming convention for your variables. If you are using web service calls, try to prefix the variables needed for the web service with something like (WebService…).

When you create an item in a list, workflow designer will automatically create a local variable of type GUID called (create) that represents the GUID of the item created by the workflow designer on that list.

SharePoint Workflow Designer Tips P1 2326

What I usually do is to create a variable with type GUID, and called it (MyReports GUID) and use it instead of the automatically created on. I then go and delete the variable called (Create). This way, my variables will be more descriptive.

SharePoint Workflow Designer Tips P1 23622

Sometime, when you are beginner in writing workflows using SharePoint designer, you will end up with many variables that are created and not used inside your code. Keep an eye on those orphan variables and delete them as soon as you can so that you do not confuse yourself. This will make it easier for you and others to review your code later and get an idea about what’s going on.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s