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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

skipper68Application 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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.