Sue Hernandez's SharePoint Blog

SharePoint and Related Stuff

Category Archives: SharePoint Designer

Problems publishing SPD 2010 workflows and InfoPath forms

So I have been working on a project on SharePoint 2010 that is basically a list where the input form has been customized using InfoPath.  We decided to go this route using a list instead of using a Forms library because of the capability in workflow to send dynamic emails to multiple people if and only if it comes from a Person or Group column.

The problem came when I got up around 75 columns.  Suddenly, I found that I could no longer publish the InfoPath form.  I got “The SOAP Message could not be parsed.”  If I removed a column or 2, or got rid of a rule, or a data connection, suddenly I could publish again.  But there seemed to be this magic, undefined breaking point that I couldn’t exceed before I’d start running into problems.

So now, I had to implement the SharePoint Designer 2010 workflow.  I knew I needed probably 3 workflows, one for create, and 2 for on change.  However, once I got past 2 or 3 IF statements, I could no longer publish the workflow either.  It would save, but on publish it would give me “Unexpected error on server associating the workflow.”  Now mind you, I did NOT have any Start Approval Process or similar actions – one of those content-type actions.  These were just simple conditions, emails, and setting of a few fields.

I found that I had to break my work up in to 16 workflows.  Each one started out with a condition to see if it should run.  This was getting ridiculous, and finally I got to a point where I couldn’t get any more granular and still it wouldn’t publish.  As suggested by some posts, I tried increasing $app.UserDefinedWorkflowMaximumComplexity in PowerShell (where $app is the SPWebApplication in question) and I also tried adding a timeout value to the  web.config.

 

So this whole time, I’m working from my contractor’s computer.  The SharePoint system in question was exposed over the internet using a UAG appliance for firewall and authentication.  Normally, this is not an issue, as I can usually get everything done I need to. On a whim I decided to open everything up from the customer’s computer, which incidentally has a VPN connection to their system, and voila, I can publish InfoPath forms and Workflows now with no issue.  <sigh>  It’s the little things that get you.

 

http://fairulshahrizat.blogspot.com/2012/12/sharepoint-designer-2010-workflow-error.html

 

SPD 2013 Workflows – Wait for Change booleans

The Scenario:

I have an approval process in my InfoPath form.  When the user presses a button called Approve or a button called Reject, it fills in 3 read-only fields:  ApprovalName (with currently logged in user name); ApprovalDate (with today); and Approval (Boolean with blank default – true means approved, false means rejected).

In SharePoint Designer 2010 what I would do is to use an action called “Wait for field change” (not sure if that’s the exact action name).  I would give it the ApprovalName field and say Wait until Field ApprovalName is not empty.

The reason I choose that field is because I do not wait to wait until Approval is true – because true means approved; what if it’s rejected?  I can’t wait for it to be false either for that same reason.  In 2010, it wouldn’t give you the choice for Boolean fields to say “is not empty” so I chose the text field instead, the person’s name, that gets auto-populated when the button is pressed.

The Problem:

I ran across 2 problems.  The first of which is that in SharePoint Designer 2013, with the 2013-compatible workflow, you can no longer choose things like “Contains”, “Is NOT Equal to”, “Is greater than”, “Is not Empty”, etc.  You can ONLY choose Is Equal To.  As a matter of fact, it’s not even a choice – it’s hard-coded right in there – you can’t even click “is Equal To”.

So what I figured I’d do, is to create another field in InfoPath called ApprovalCompleted as a Boolean, with false as the default.  When you press EITHER the Approve or Reject buttons, it turns the ApprovalCompleted field to true.

So I went in to SharePoint Designer and changed my Wait for Field Change to ApprovalCompleted.  For the value it wouldn’t allow me to fill anything in – it only gave me a Yes or No.  So I chose Yes.

No matter how many times I chose “True” in that blasted InfoPath Form, the Workflow would never get past that Wait for Field Change action – it never equaled.

The Solution:

I Googled around a bit and found that others had the same problem – Boolean fields just never match in a Wait for Field Change action.  I think it’s because it’s storing it as a 1 or 0 and the action expects “Yes” or “No”.

So there’s 2 ways of handling this.  One way is to go back into your InfoPath form and change ApprovalCompleted into a text field and have a textual representation of completion when they click the Approval or Rejection buttons.  That way you can set the Wait for Field Change action to equal a particular string that you’ve set in the InfoPath form.

The other way to do it is to set up a Calculated Field on the Form Library.  So to be clear, you need to promote ApprovalCompleted as a Boolean field (in this particular way of handling it) to the Form Library.  Then you go into the Form Library and create a new field, and call it something like ApprovalCompletedCalc.  Set its formula as just outputting the ApprovalCompleted field, and set its output format as a Number (doesn’t really matter if you use number or string here).  Now in your workflow, you need to Wait for Field Change to be the field ApprovalCompletedCalc and it needs to equal the value 1 – 1 for true, and 0 for false.  No quotes, just the number 1.

Extras:

Couple of interesting things to note.  First is, is that if you have that Calculated Field in your view, and you’ve TOLD it that it’s supposed to be a number, it’s still going to read as “Yes” and “No” EVEN THOUGH it’s really storing 0 and 1.  To be clear, do NOT set your SPD workflow to look for “Yes” or “No” – it needs to be 1 or 0.  But yes, the view is confusing and shows you the text.

Also, in SPD, in a condition, the Yes/No value seems to WORK right.  So if you say “If Approval Is Equal To Yes” it works right.  It captures the “true” or the 1.   So it’s just that other action, the wait for field change action, that is messed up.

 

SharePoint Designer 2010: You do not have permission to do this operation

SharePoint Designer 2010:  You do not have permission to do this operation
–  or  –
Master Page Error:  The Master Page File ‘https://yourserver.com/yourPath/yourSC/_catalogs/masterpage/v4.master‘ cannot be loaded.  Attach a different Master Page, or correct the problem in Code view.

Environment Specifications: 

  • SharePoint Designer 2010. 
  • Windows XP OR Windows 7
  • All of the problem sites were sites that had been migrated from 2007
  • All of the users having problems had FULL CONTROL of the sites they were trying to get into
  • When using a VPN, we always get both errors
  • When outside of the network completely (our site is accessible on the internet with credentials) then we sometimes do not get the first error, but we can’t put the page into Design mode because of the second error.

So we figured out that it had something to do with permissions at the Master Page Gallery at the top of the site collection.  But what was wierd was that any new subsite we created did NOT have this problem.

Well, to make a long story short, we were right, and it’s a “feature”.  KB Article http://support.microsoft.com/kb/2592376 from Mirosoft explains that you have to be one of 3 different permissions, at the site collection level, in order to edit in designer:

  • Site Collection Administrator
  • Designer
  • Owner

Now we whittled it down to this – you don’t have to be in the “Designers” group at the top of the site collection – but if your configuration of the Master Pages Gallery was untouched, that WOULD work (because Designers were set as Design level in the Master Pages Gallery).  Basically the short of it is, you need to HAVE DESIGN OR GREATER PERMISSIONS ON THE MASTER PAGE BEING USED (or just the whole gallery) at the TOP OF THE SITE COLLECTION.

Turns out the reason for these varying behaviors is this:  In 2007, new sites would automatically inherit their master pages from their parents.  If you made no changes to that, it inherited right up to the top.  So it’s looking at the master page from the top, in those circumstances.  And as we’ve seen here, if you don’t have Design permissions to it, it doesn’t work.

In the case of a new 2010 site (just a regular Team Site), the new 2010 behavior is to use the Master Page in the gallery it has in its own site.  And since the user is an Administrator (Full Control) of that site, then no problem getting to the Master Page!

Just so you know, we did end up calling in a Microsoft Ticket on this one, to confirm our findings.  We knew at that point it had to be something about permissions at the top, but we didn’t know why.  They confirmed it, providing the KB article I mentioned earler, and the explanation you see in this article.

9-8-2011 SPUGDC Presentation Handouts

Here are the handouts for tonight’s presentation at SharePoint User Group DC on the topic of Advanced Workflows using SharePoint Designer 2010.

SPUG Presentation PowerPoint
SPUG Presentation – SharePoint Designer 2010 Advanced 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.

SPS 2003 with SharePoint Designer Data View

“The server for the data source returned a non-specific error when trying to execute your query.  Check the format and content of your query and try again.  If the problem persists, contact the server administrator.”

I am logged in to SharePoint Designer as a test account that has administrative rights to the site in question.  I can’t even “Show Data” on the SharePoint List (any of them) – I get the error above.

Further, logging in as a Site Collection Administrator does not solve this problem.  However, logging in as a Domain Administrator account with rights all over the place, it works without a hitch.

Please help if you know of any solutions – please comment on this post.

Thanks
Sue Hernandez