Posts Tagged ‘SharePoint Designer’

How do I – Create a recursive escalation workflow in SharePoint using Visio 2010 Premium

Written by Cornelius J. van Dyk on . Posted in How Do I...

One of my attendees to my Human Workflow with Visio 2010 and SharePoint Designer 2010 session in Las Vegas recently, emailed me with an interesting question.  Eric was looking to recursively check if a CSR ticket was resolved and then resend the email until it was completed.  After responding to Eric with my recommendation on how to address his specific needs, I started thinking about escalation workflows in SharePoint.  Escalation is always interesting and usually more complex to implement that most people expect when trying it for the first time.  So I modified my model I generated for Eric and grew it into an escalation workflow for a fictitious company.

If you’ve ever tried doing something similar, you probably found out quickly that SharePoint won’t allow you to create a circular relationship in the workflow back to itself.  This fact alone had drive many people to more advanced workflow tools like Sourcecode’s K2[blackpearl].  We do not however, have to establish a visible circular relationship in the workflow.  Here is my design:

image_3dd43ec2-3445-47ae-9567-e36ab94d1af2_6712DDEE

You will note the following:

  1. EscalationCount – This is a metadata field that we add to the form data which keeps track of how many times we’ve escalated.
  2. The workflow terminates after incrementing the EscalationCount value.
  3. Our workflow is published with settings that restarts the workflow if any values in the active item changes.  THIS IS THE IMPORTANT SETTING TO REMEMBER!!!

This is how this workflow would function:

  1. When the workflow first starts, we will have an EscalationCount value of 0.  Checking this value would force it down the first row of the workflow path.
  2. An email is sent to the CSR
  3. The workflow dehydrates (goes to sleep) for 7 days. 
  4. When it wakes up, it checks if the task is complete.  It should be noted that this check can be anything you want it to be, as long as it signifies that the work has been completed.  If after 7 days the work is found to have been completed, the workflow ends normally.  If however the work isn’t complete, the EscalationCount is incremented at #25.  Because the workflow is configured to restart itself upon change, incrementing the count will restart the workflow from the top thus creating the circular relationship we need.
  5. Check that EscalationCount is 1.
  6. Look up the CSR’s manager.
  7. Send an email to both parties.
  8. Dehydrate for 2 days.
  9. Check if task is completed.  If not completed, increment EscalationCount again.
  10. Check that EscalationCount is 2.
  11. Look up the manager’s manager.  In this case we called it the Department Manager.
  12. Send an email to all three.
  13. Dehydrate for 1 day.
  14. Check if task is completed.  If not completed, increment EscalationCount again.
  15. Check that EscalationCount is 3.
  16. Look up the Department Manager’s manager, in our case, the CIO.
  17. Send and email to all four.
  18. Dehydrate for 1 day.
  19. Check if task is completed.  If not completed, increment EscalationCount again.
  20. Check if EscalationCount is 4 or more.
  21. Look up the CIO’s manager, the CEO.
  22. Send and email to all 5.  (Honestly, if the workflow ever makes it to here, this company should NOT be in business!!!)
  23. Dehydrate for 1 day.
  24. Check if task is completed.  If not completed, increment EscalationCount again.

At this point, the workflow will continue to send email to all 5 people on a daily basis.  That’ll continue until the task is completed, or (more likely) the workflow is removed from the list altogether.

So that’s how we do recursive escalation workflow using Visio 2010 Premium.  From here you simply export the workflow to SharePoint Designer 2010 and implement it on your target list.



Cheers
C




image

How do I – Change the target of the Edit menu from EditForm.aspx to something else in SharePoint 2007?

Written by Cornelius J. van Dyk on . Posted in How Do I...

With the use of SharePoint Designer 2007, you can easily override the target of all the “Supporting Files” as they’re referred to, by following these steps:

http://www.cjvandyk.com/blog/Articles/How-do-I—Change-the-target-of-the-Edit-menu-from-EditForm.aspx-to-something-else-in-SharePoint-2007.aspx



Cheers
C




image

How do I – Customize the NewForms.aspx or EditForm.aspx of my SharePoint list

Written by Cornelius J. van Dyk on . Posted in How Do I...

Sometimes, it is necessary to override the default list edit forms provided by SharePoint. A common example is the “Title” column. In most cases, we design our lists to have some field that is a single line text field that we can map to the Title field. The reason that has to be done is because SharePoint throws the Title field into the list by default. This behavior cannot be changed, so we have to work around it.

In some cases, we don’t have any single line text fields in the list, and in such cases, the only thing we can do is to IGNORE the field. It’s pretty hard to ignore the field if we still see it though. This is when we would want to override the NewForm.aspx and EditForm.aspx pages.

Another example would be when we are designing a Support Request type of form. In such a case, the user filling out the form doesn’t care about all the tracking information we tie to the form, such as who it’s assigned to etc. All they care about is to give us a description of the error. A minimalist approach would have the user making the support request fill out just a Title and Description of the error.

If the form the user is filling out has lots of other fields in it, it can be confusing for the user. This is another good example of when we would want to override at least the NewForm.aspx page.

To override default forms and hide fields:

  1. Begin by launching SharePoint Designer.
  2. Using the File/Open Site menu, open the target site.
  3. As always, backup, Backup, BACKUP!!!
  4. Navigate to the target list.
  5. You should see the forms AllItems.aspx, DispForm.aspx, EditForm.aspx and NewForm.aspx in the listing.
  6. Right click the form you’re about to edit.
  7. On the popup menu, click “Copy”.
  8. clip_image002
  9. Now right click somewhere in the white space of the listing.
  10. On the popup menu, click “Paste”.
  11. clip_image004
  12. The forms list should now show a backup copy of the form we’re about to edit e.g. “NewForm_copy(1).aspx” if we backed up the NewForm.aspx.
  13. clip_image006
  14. Double click the NewForm.aspx to open it. It should look like this:
  15. clip_image008
  16. What we want to do, is insert a new “Custom List Form” in order to control the controls used on the page.
  17. Select the list form that is there by clicking on it. The entire thing should be highlighted, as above.
  18. VERY IMPORTANT!!! Do NOT miss this step. With the list form selected, press the RIGHT ARROW key on your keyboard, one time.
  19. This moves the cursor just to the right of the list form. It also unselects the list form. This is the exact position where we wish to insert our custom list form content.
  20. From the menu, select “Insert/SharePoint Controls/Custom List Form”.
  21. image
  22. In the modal window that pops up, change the “List or document library…” dropdown to target your current list.
  23. Leave the “Content type…” dropdown value as “Item”.
  24. Check the radio button for the type of form to insert. In our example, we’re overriding the NewForm.aspx so we select the first value.
  25. Click “OK” to insert the content.
  26. clip_image012
  27. Your page should now look like this with the standard list form content on top and the new custom list form content right below it:
  28. clip_image014
  29. Scrolling to the bottom of our list, we find the controls we wanted to remove from the NewForm.aspx.
  30. Select the entire row.
  31. clip_image016
  32. Right click on the selected row.
  33. On the popup menu, click “Delete/Delete Rows”.
  34. clip_image018
  35. The row and it’s controls should now be missing from view.
  36. clip_image020
  37. Now that we have the custom content ready, we need to hide the default content.
  38. IMPORTANT!!! DO NOT DELETE THE DEFAULT LIST VIEW CONTENT!
  39. Select the default list content by clicking on it.
  40. clip_image022
  41. Now click the “Split” view button below the preview window. This should show you both the preview AND the source code behind it. Note the <IsVisible> node value of “true”.
  42. image
  43. Double click on the <IsVisible> line to edit it.
  44. Change the value to “false”.
  45. image
  46. Click the “Save” icon to commit your changes.
  47. image
  48. If it’s the fist time editing the form, you will be prompted with this warning:
  49. clip_image030
  50. The warning basically just warns that the list is being customized, which we already know because that was our intention from the outset.
  51. Click “Yes” to continue.
  52. Now when you go to add a new item to the list, the new form we just designed, is used and the fields hidden.
  53. clip_image032


Cheers
C




image