Can't retrieve approval status in Globally Reusable Workflow (Approval - Sharepoint 2010)

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?

May 5th, 2014 2:29pm

When you deploy the workflow on the list, the workflow content type creates approval column in the list.
Free Windows Admin Tool Kit Click here and download it now
May 5th, 2014 2:53pm

Yeah i understand that, but it needs to be a Globally reusable Workflow, that way i can copy it to the local libraries of every individual site.

And in the Globally reusable workflow, i cannot select the field "Approval Status".

May 5th, 2014 3:04pm

Hi Velocity,

According to your description, you want to retrieve approval status in Globally Reusable Workflow.

The approval status column is a system column which can only be used when Content Approval is enabled in a list or library.

The Globally Reusable Workflow is not associated with a list or library, so it cannot get the approval status column until the workflow is associated with a list or library which has the Content Approval enabled.

It is by design that Globally Reusable Workflow cannot retrieve the approval status column.

I recommend to create List Workflows to retrieve the approval status column when the Content Approval is enabled in the list or library.

Best regards.

Thanks

Free Windows Admin Tool Kit Click here and download it now
May 6th, 2014 3:02am

Thank you Victoria! I understand partially!

The only strange thing is, that a friend of mine had it default out of the box; the parameter Approval Status.

On a Global Reusable workflow! How can this be? This was not a List Workflow!

I'm trying to add images, but my account is not verified so i can't show the images where you can see that he has a global reusable workflow with that "Approval Status" parameter available in the workflow.

May 7th, 2014 1:15pm

Hi Velocity,

I recommend to check the Item content type in your friend's site to see if the Approval Status column listed in the content type.

If yes, check the Approval Status column to see if the column is the system column Approval Status enabled with Content Approval.

Best regards.

Thanks

Free Windows Admin Tool Kit Click here and download it now
May 8th, 2014 1:35am


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!

June 4th, 2014 9:03am

Thanks Velocity88 - this helped me.

I agree though - seems odd you can't select it in the workflow when it is clearly referenced in this Microsoft article on workflows - https://support.office.com/en-ca/article/Introduction-to-designing-and-customizing-workflows-32c9c0bf-5e20-4f74-8b9c-d3ea79f2962b

Free Windows Admin Tool Kit Click here and download it now
April 30th, 2015 9:30pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics