0

For day's i am trying to implement the following in one of the standard, out of the box, Globally Reusable Workflow with Sharepoint Designer 2010:

If Current Item:Approval Status not equals 0:#Approved Start Approval Workflow Task process on Current Item with Parameter:Approvers Else //Nothing

This is to prevent that a workflow is started if the item is already approved! The strange thing is, a buddy of mine has also Sharepoint 2010 and he can select in the DropDown list -Current Item: -> Approval Status..

But the only things I can select are the following:

  • Content Type
  • Created By
  • ID
  • Modified
  • Modified By
  • Title

I don't understand what is going wrong! What am i forgetting to configure or bind or set? My situation:

Picture from my situation

His situation: Picture from his situation

  • No one any clues? – Velocity May 5 '14 at 14:21
0

I have found the solution!

I have setup an test environment, Sharepoint 2013 on MS Server 2008R2 and installed Sharepoint Designer 2013. When I now edit the default out of the box "Approval - Sharepoint 2010", if you enter the condition "if current item field equals value", you can now select "Approval Status"!!

So this means that it IS available after all! After a lot of trying, searching, this is the solution in a Sharepoint 2010 environment, installed on MS Server 2008R2:

  1. Edit the (global or copied version if you want) workflow.
  2. Add the condition "if current item field equals value" as a step.
  3. Select from the item field: Content Type
  4. Click on "equals" and change it to "not equals"
  5. Then click on the condition and enter manually the following: 0;#Approved
  6. Move the task "Start Approval Workflow Task..." up so it is a part of the condition "If.. "
  7. Add an Else condition
  8. Enter here your custom action or log to show the user that the Task is not performed.
  9. Save the workflow.

We now have to manually edit the Workflow Rules file.

  1. In Sharepoint Designer 2010, click at the left side of the ribbon on "All Files".
    • If you have created a custom workflow, you can find the "Workflow.xoml.rules" file, in the folder Workflows/"Your custom workflow"/"CustomWorkflow.xoml.rules".
    • If you are using the global, out of the box Workflow, you can find the .rules file in: _catalogs/wfpub/Approval - SharePoint 2010/ReviewApproval_1033.xoml.rules
  2. Click on the file, then in the next screen click on "Edit file" under Customization. 4.Search for the string "ContentType" 5.When you have found the string, it looks a bit like this:

ns1:String xmlns:ns1="clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">ContentType ns1:String

(When you look a few lines below this line, you see your added condition 0;#Approved)!

6.Replace the string ContentType with: _ModerationStatus 7.Save the file! 8.Open in the current directory the "Workflow.xoml" file (this is the workflow itself) 9. Click on the Save button, it will give you a notice:

A more recent version of _catalogs/wfpub/Approval - SharePoint 2010/ReviewApproval_1033.xoml.rules has been saved to the server by "user" on 1/5/2014 10:50 AM.

Do you want to replace this with your file?

Click NO! (Important, otherwise it will replace it with the default rules file, and nothing has changed!)

  1. Close Sharepoint Designer 2010, reopen SPD2010 and go to the workflow.
  2. Edit the workflow and you'll see the following now:

"If Current Item: equals 0;#Approved"

The field Content Type is now gone! This is correct so don't worry!

  1. Publish the workflow and you are done!

  2. Check now on a library that has a link to the edited workflow, when you start a new Workflow on a Approved-Major version of the document, what the outcome is:

The workflow is discarded because of the condition and nothing happened, so your document stays on the most recent Approved-Major version and is not published back to a previous version number!!

Conclusion: I think that the Sharepoint 2010 Designer, is missing that specific "Approval Status" field, but with the solution i have just given, you can solve this!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.