Page 1 of 1

Does the Vault Client API have a way to get Local Version #

Posted: Wed May 03, 2017 3:02 pm
by HenryEI
I need to use the Vault API to get the Local Version number being displayed on Vault to get my interface working properly. I have seen old posts with people asking for such a feature, but I never saw if it was added, and have not found a way to access it in my own inquiries.

Has this been added? If not is there a work around?

Here is what I want: Given a VaultClientFile, return the Local Version Number shown on Vault.

Re: Does the Vault Client API have a way to get Local Versio

Posted: Wed May 03, 2017 3:26 pm
by Beth
Did you check out this post here?
viewtopic.php?f=32&t=13968&p=58791

I'm going to move this question over to the Development Tips part of the forum so it is with the other API questions. If you have not seen that section, that's the place to check (viewforum.php?f=39).

Re: Does the Vault Client API have a way to get Local Versio

Posted: Wed May 03, 2017 4:09 pm
by HenryEI
Thank you for the reply. I had not seen that post, however it does not seem to work.

When I tried recreating this line:

WorkingFolder wf = ClientInstace.TreeCache.GetBestWorkingFolder(f.Parent);

It turned out that .GetBestWorkingFolder now returns a string, and not a working folder object so that did not work.

Re: Does the Vault Client API have a way to get Local Versio

Posted: Thu May 04, 2017 11:06 am
by jclausius
Where did you get the VaultClientFile object from? From the current repository? If so, :

VaultClientFile f;
long nObjectID = f.ID;
long nVersion = f.Version;
long nObjectVersionID = f.ObjVerID;

Re: Does the Vault Client API have a way to get Local Versio

Posted: Thu May 04, 2017 3:13 pm
by HenryEI
I did get the VaultClientFile from the current repository, but the information you just gave me gives me the "Remote Version" number displayed in Vault. I want the "Local Version" number.

I have no issue getting the Remote Version Number or the Status, but that Local Version number is extremely important to my current project.

Re: Does the Vault Client API have a way to get Local Versio

Posted: Thu May 04, 2017 3:18 pm
by jclausius
Sorry. Had the wrong version in mind. Try this :

VaultClientFile file = <some vault client file from the repository>;
WorkingFolder wf = ClientInstance.GetWorkingFolder(file);
long localVersion = wf.GetDisplayVersion(file);

Re: Does the Vault Client API have a way to get Local Versio

Posted: Thu May 04, 2017 3:40 pm
by HenryEI
That worked perfectly! Thank you so much.

Re: Does the Vault Client API have a way to get Local Versio

Posted: Thu May 04, 2017 3:43 pm
by jclausius
No problem. I'm glad I was able to get you what you needed.