sharepoint 2013, workflow and versioning


sharepoint 2013
a library with versioning major and minor activated
approval activated, but everyone can see draft

excel cannot see the sharepoint version

to be able to see the sharepoint document version in excel i created a column in my document type called "spversion"

then, a workflow "on creation" and "on change" update this spversion column with the actual version of the document

Définir spVersion à la valeur [%Élément en cours : Version%]
in english:
SET spversion to [actualelement:version]

by the time the workflow update my spversion column, the document was modified, then the version is changing, so my column spversion is obsolete the second after it was updated

so i decided to change a field before i copy the version to trigger the version update wich i tought would trigger only once in the workflow

but noooo, the version change at EVERY action the workflow do, so it changed twice and my spversion column was outdated again

if i compare the two column before doing the update action, it will be fine unless it's not the same value and the workflow start, wich will change the version just after i update my spversion column

Any ideas?

the only thing that come to my mind is to split the version in 2, then add one to the minor version part, then reunite it again, then put content in my column spversion. the version will be the same after version is also upgraded by one folowing the workflow action
(wich i dont know if i can do in sharepoint designer OOTB)

but even then, when a major version is published, the document will return to draft state because of the workflow
Wich is bad

I would prefer to turn off versionning and approval status update for all the workflow duration

or tell sharepoint that my spversion column is not part of any event about version or approval status
Who is Participating?
skipper68Connect With a Mentor Application Development ManagerCommented:
I'm not sure what your comfort ability level with SP development but you could build an event receiver that runs upon 'item added' so it wouldn't fire until after the db commit happens.

In the event receiver you can do just about anything including updating properties as the system (which prevents the modified date and user from being updated) to exporting as a cvs file to be used in Excel.
STASBizAuthor Commented:
I am very comfortable with visual studio programming
I imported all my terms (managed metadata) with a console application with recursive sub on my sp 2013 server

I searched and searched for a inbox solution and found none :(

I checked a vm, and the creation for event receiver is there in visual studio as long as you install OfficeToolsForVS2012RTW (2013, v15)

I will now install visual studio and the office tools for vs2012 pack on the server

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.