cancel
Showing results for 
Search instead for 
Did you mean: 

Get specific version using javascript

sleeper
Champ in-the-making
Champ in-the-making
I am trying to download a specific version using javascript.
I use the get
node.getVersion(version_var);

And I have to assume this is right.  When I give it a valid version number  it returns an object, if I give it an invalid version number I get an error.
However, I cannot figure out how to get the actual older version of the file.
Whenever I try to get the ID or url I always get the same value as the current node.
When I call versionLabel or nodeRef I get errors about undefined values.


Does anybody know how to get the older version of a file using javascript?


Thank you.
3 REPLIES 3

kaynezhang
World-Class Innovator
World-Class Innovator
node.getVersion(version_var) return an object of  ScriptVersion.

ScriptVersion has following properties:
 nodeRef 
  representing the node reference of the document that was versioned.
 node 
representing the node as it was versioned.
 label 
representing the version label.

sleeper
Champ in-the-making
Champ in-the-making
Yes that was it thank you.  I kept looking at the nodeRef and it was the same.  The .node is that I needed. 

Thank you.

kaynezhang
World-Class Innovator
World-Class Innovator
You are welcome ,good luck.