I'm stumped....I need to update a field on a page based on the value of another field in the page. Specifically I'm working in the Pages Library of a publishing site and the library is set up to require check out (no content approval required).
The below workflow works well to hijack the check in process and update the field in question. The problem is I only want it to run if the user is publishing or checking in a major version of the page. Currently it will hijack the check in process for any document that meets my Run if criteria.
Does anyone have any good suggestions on the best way to determine if a user is checking in a major or minor version?
Thanks in advance
you should have an item property called Version..with it, at the start of your workflow, you can check if its value ends with .0 (meaning that's a major version) or not..if not you can end the workflow otherwise you can proceed with what you do..
Just a note..as you have described your workflow, currently if people publish version 1.0, after your workflow has been executed the page will have version 2.0 (because the workflow publish the page as major version again), is it ok?
An additional thing you have to check if that doesn't create a loop (user publishes a major version, wf starts and publishes a major version.. does it trigger the workflow again?), if it creates it, you have to add some logic to avoid it, maybe a yes/no field that changes value between minor and major version, updated by workflow itself, and let the publish logic start based on version value and yes/no field.
Seems I tried something along this line where I tried to capture the version as the first and last step of the workflow but version # was the same leading me to think that the version didn't actually change until after the workflow ran completely.
However because I spent so much time on trying to get this to work, I'm going to revisit with a clear head also I'm armed with a lot more information that I was when I started.
Thanks for taking the time out to respond!