Hi folks,
Today i am going to give a work around solution for common requirement that we face from our clients on content approval and designer workflow triggering.
Case: Client is having a document library with custom SharePoint designer workflow. Content approval is activated on this library. Which means, you will see Check out, Check in, Publish, Approve, Reject options.
User requirement is, the custom designer workflow (any logic u wish) should fire only after user hits publish button of an item.
Solution: OOB we dont have such workflow triggering features. We have only On Item Created and On Item Updated. So i decided for a workaround by using On Item Updated option. It is by using "Approval Status" column.
When you enable content approval, you will see a new OOB column called "Approval Status" which will be usually having status "Draft", "Pending", "Approved", "Rejcted". The steps are..
1. Make your designer workflow trigger on every item update
2. Add a first step/stage ( SP 2010/SP2013) to decide the "Approval Status" value.
3. Create a workflow variable of type string and name it as "CurrentApprovalStatus"
4. Set workflow variable "CurrentApprovalStatus" to "Current Item:Approval Status"
5. drop If action and check If CurrentApprovalStatus equals 2 then go to required stage of yours. Usually it will be your initial stage of workflow. Else Go to End of workflow.
Note: We are comparing with 2 as the status after clicking publish will be "Pending" which is internally 2
FYI: The other values of Content "Approval Status" column are:
0 - Approved
1 - Rejected
2- Pending
3- Draft
4- Scheduled
Basically i wrote the explanation by considering SP 2013 designer workflow. I believe there will be slight changes in Action names for SP 2010 workflows.
If any suggestions/corrections, most welcome....
thank you
Today i am going to give a work around solution for common requirement that we face from our clients on content approval and designer workflow triggering.
Case: Client is having a document library with custom SharePoint designer workflow. Content approval is activated on this library. Which means, you will see Check out, Check in, Publish, Approve, Reject options.
User requirement is, the custom designer workflow (any logic u wish) should fire only after user hits publish button of an item.
Solution: OOB we dont have such workflow triggering features. We have only On Item Created and On Item Updated. So i decided for a workaround by using On Item Updated option. It is by using "Approval Status" column.
When you enable content approval, you will see a new OOB column called "Approval Status" which will be usually having status "Draft", "Pending", "Approved", "Rejcted". The steps are..
1. Make your designer workflow trigger on every item update
2. Add a first step/stage ( SP 2010/SP2013) to decide the "Approval Status" value.
3. Create a workflow variable of type string and name it as "CurrentApprovalStatus"
4. Set workflow variable "CurrentApprovalStatus" to "Current Item:Approval Status"
5. drop If action and check If CurrentApprovalStatus equals 2 then go to required stage of yours. Usually it will be your initial stage of workflow. Else Go to End of workflow.
Note: We are comparing with 2 as the status after clicking publish will be "Pending" which is internally 2
FYI: The other values of Content "Approval Status" column are:
0 - Approved
1 - Rejected
2- Pending
3- Draft
4- Scheduled
Basically i wrote the explanation by considering SP 2013 designer workflow. I believe there will be slight changes in Action names for SP 2010 workflows.
If any suggestions/corrections, most welcome....
thank you
No comments:
Post a Comment