Windchill REST Services Framework Capabilities > Retrieving the Latest Version of an Entity
Retrieving the Latest Version of an Entity
You can retrieve the latest version of an entity using the custom query option ptc.search.latestversion. The option takes true, false, or absolute as input value.
When you specify the query option as true, it returns the latest version that matches the search criteria.
When you specify the query option as false, it returns all versions of an object that match the search criteria.
When you specify the query option as absolute, it returns a result only if the absolute latest version matches the search criteria.
For example, the following URI retrieves the latest version of the parts:
GET /Windchill/servlet/odata/ProdMgmt/Parts?$filter=startswith(Name,'Axle')&ptc.search.latestversion=true
The following rules apply to the ptc.search.latestversion option:
The value specified for latest version in the query option gets precedence over the value set for Latest Version Search preference in Windchill.
If the query option is not specified in the request URI, the value set for Latest Version Search preference in Windchill is used.
* 
If the value set for the Latest Version Search preference in Windchill is the default value All, it returns the result corresponding to the value false.
If the value set for the Latest Version Search preference in Windchill is Latest, it returns the result corresponding to the value true.
If the value set for the Latest Version Search preference in Windchill is Absolute Latest, it returns the result corresponding to the value absolute.
¿Fue esto útil?