Sue Hernandez's SharePoint Blog

SharePoint and Related Stuff

Category Archives: Workflow

Workaround: SharePoint Workflow and Task Assignment by Email Address

SharePoint Desinger Workflow with InfoPath not filling in the Assigned To field on a Task when you specify it by Email Address
What we have here seemed to be pretty simple:  we have an InfoPath form where you filled in your name and email address, and then your manager’s name and email address (I know we could have done that automatically but that’s besides the point for this post).  Then we have a SharePoint Designer workflow that first forcibly sends an email to the Manager’s Email using the “Send an Email” action, and it then uses “Assign a To-Do Item” i.e. creates a task to the manager, AGAIN BY THEIR EMAIL ADDRESS, not by a login name.

Well to complicate the matter just a little bit, we have 2 domains – one of which is a “One Way Trust”.  Now that being said, you can add users from this second domain no problem either using the Add User people picker, or by going into a new task manually and using the people picker.  So it is getting to the other domain fine (we have already run the stsadm command -o setproperty -pn peoplepicker-searchadforests).

What the problem was, though, is that when we fill out an InfoPath form, and for the manager’s name, use an email that resolves to an account on our “local” domain, it works just fine.  However, as soon as you try to assign a to-do item, by email address, to a user in the One Way Trust domain, we end up with a blank Assigned To field in the task that was created for us.
We still don’t have a solution, but here’s the workaround:

We found a workaround.  Here’s the steps that I took to get this “working” per se:

  • Inside SharePoint
    • Create a Person Field
      • Create a new Column in the InfoPath Form Library. 
      • Make sure it is a Person or Group field. 
      • Make sure it selects from “All People”.  
      • For sake of our example, we’ll call it “Manager Assigned”
  • Inside your SharePoint Designer Workflow
    • Assign the email address into the Person Field
      • Add the action “Set Field in Current Item”
      • Click “field” and set it to the Column you created in step 1 (“Manager Assigned”)
      • Click the “value” and in the “Select Users” dialog box double-click “Workflow Lookup”
      • From the “Current Item” as a Source, choose the field in your InfoPath Form that represents your email address you want to use (“Manager Email”)
    • Pause the workflow
      • Add the action “Pause for Duration”
      • Set it to 0 days, 0 hours, and 1 minutes
    • Assign your Task to the Person Field
      • Add the action “Assign a To-Do Item” (or “Collect Data from a User”)
      • Set up your task’s name and description (and any custom fields for a Collect Data action)
      • For the person that you want to assign it to, double-click “Workflow Lookup”
      • From the “Current Item” as a Source, choose the custom field in your Form Library that represents the Person Field (“Manager Assigned”)

We also tried just pausing first and then setting the Task directly to the email address, but that didn’t work either.  Something about it not being able to resolve the user name in a timely manner when it’s creating the task.

So if you all have run in to this, and have an answer, please comment here.  If we come up with a true solution, I will update my post.

Advanced Workflow Webinar – May 27 10am EST

Another webinar is coming up!  See my company’s web site to learn more or regster at http://www.akgroup.com/Pages/AWWC.aspx

Scenario

When a user in your organization requests a new phone, there are a few approvals that are needed:  if the request is for a regular phone, you just need the manager’s signature; if the request is for a Blackberry, then you need both your manager’s signature as well as a manager in the Blackberry group.

Once the request has been approved, a technician should be assigned to order the phone.  Once the phone comes in, the technician needs to record that the phone came in, and the Inventory needs to be adjusted based on the type of phone.

Every step in the process, the employee should be notified of the status.  When the phone has been received by the employee, they need to Accept an inventory agreement by completing a task in the workflow.

You Will Learn

  • Using Conditions to control the flow of a Workflow
  • Routing the List Item for Approval
  • Assigning Tasks to a User via the Collect Data From a User action
  • Updating data in the List Item
  • Updating data in another List
  • Email Notifications and Building Dynamic Strings
  • Using a To-Do item to force acceptance to a policy

EXTRAS

  • How To Copy a Designer Workflow to another Site
  • How To Copy an Action to several places in the Workflow
  • How To Associate a Designer Workflow with a different Task List

Handout from Feb 18 SUGDC Workflow Session

 Last night (Feb 18 2010) I spoke at the SharePoint User Group DC and gave a 1 hour presentation on the “Art of the Possible” with Designer Workflows.  I took one specific example, and worked it out in a SharePoint Designer Workflow and went through setting up the workflow step by step in the presentation.

Here is the PDF file that I handed out last night, which is a transcript with illustrations of everything covered.  Please feel free to download from here and please comment if you have questions or ideas or comments.

SharePoint Designer Advanced Handout

The scenario:

Your group is responsible for conducting training classes on several different systems.  Users need to be able to register for training and specify the class they want to train in.   The training administrator needs to be notified that they have to assign a class to a new registrant.  Once the administrator assigns the class, the class attendance should be adjusted. Then an email should go out to the registrant to notify them of the class Date and Time and refer them to the Meeting Workspace.  Once the class has been completed, an email goes out to the user thanking them for taking the class.  If they have not completed the class, the Registrant should be forced to start over with a new registration.

Workflow Webinar Announced – Presented by … ME!

Please visit my company’s site for information on the Webinar http://bit.ly/5OJwf5.

Only $99!!!

Our Agenda:

  • Out-of-the-box Workflows:  Descriptions and settings
    • Reviewing OOB Workflows
    • Creating a Workflow based on an OOB template
    • Running the new Workflow
  • SharePoint Designer Workflows: Basic
    • Creating a new Workflow against a specific Doc Library
    • Steps, Conditions, and Actions – an Overview
    • Setting the First Step
      • Basic If/Else statement using Conditions
      • Assigning a Task (“To-Do Item”)
      • Using a Workflow Lookup to another list
    • Setting the Second Step
      • Sending an Email using the Workflow Lookup
    • Running the Workflow
  • SharePoint Designer Workflows: Advanced
    • Creating a new workflow against a specific Doc Library
    • Modifying the Initiation Form (Using Initiation Parameters)
    • “Log to History List” Action – Best Practice
    • Creating and Setting Variables
    • Collect Data From User action (Instead of To-Do Item)
    • Finishing the Workflow
    • Running the Workflow
  • Shortfalls of Designer Workflows
  • (Time Permitting) Sneak Peek at a Visual Studio Workflow
  • Q&A

You will receive a full Transcript of the event, as well as Homework exercises and a Quick Reference Guide.

Register Now!  http://bit.ly/5OJwf5.

Why won’t my emails send when I’m using a Workflow Lookup

I have had to fiddle around with SharePoint Designer Workflows.  What I have done is set an Initiation Parameter to the email address of a Person.  Then, in the Send Email action, I specify the To field, select Workflow Lookup… and select Workflow Data and then my Initiation Parameter.

However, the email never gets sent.  I have also tried DOMAIN\username in the Initiation Parameter, but that didn’t work either.

Thanks for any help.

MOSS – WSPBuilder and Workflow Template

I am a big fan of using WSPBuilder for building Solution packages.  I did, however find one bug that others have found and blogged about also.

First of all, I was working on my company’s PC which does not have SharePoint installed.  That had problems of its own:  I had to get some dll’s on to my local computer, and register them in the GAC, for

  • microsoft.office.workflow.tasks.dll
  • Microsoft.SharePoint.dll
  • microsoft.sharepoint.WorkflowActions.dll
  • microsoft.sharepoint.WorkflowActions.intl.dll
  • microsoft.SharePoint.workflowactions.intl.resources.dll

The last one, I had to get directly out of the GAC from a server that had SharePoint on it, by navigating to

    C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SharePoint.WorkflowActions.intl.resources\12.0.0.0__71e9bce111e9429c

Now, as for WSPBuilder, when adding a new project of type “WSPBuilder Project with Workflow”  I found that once I deployed the solution I kept getting the result “Failed on Start”.  When I looked into the SharePoint log files, it showed “Workflow Failed Validation” type of exceptions.

Turns out accofding to This Post that the project file needed an extra line – a missing import target.  Below the line

    <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

we need to add the line

    <Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets" />

This solved the problem, and the workflow then proceeded to fail miserably in expected ways as opposed to unexpected ways :-).  Until I fixed it of course.