M-Files API 23.11.13135.0
GetPathInDefaultView Method
VaultObjectFileOperations Object : GetPathInDefaultView Method
The ID of the object containing the file.
The object version to target. Use "-1" for the latest version.
The ID of the file.
The file version. Use "-1" for the latest one.

If the target object exists with versions 1 and 2, the following table summarizes the L or S specific segments of the location path: 

Flag value Requested version 1 Requested version 2 Requested version -1

MFLatestSpecificBehaviorNormal

S/v1 L/L L/L

MFLatestSpecificBehaviorSpecific

S/v1 S/v2 S/v2

MFLatestSpecificBehaviorLatest

[error] L/L L/L

MFLatestSpecificBehaviorAutomatic

S/v1 L/L L/L

True if the information should be always updated from the server.
Description
Gets the path of the file in the ID view.
Syntax
Visual Basic
Public Function GetPathInDefaultView( _
   ByVal ObjID As ObjID, _
   ByVal ObjectVersion As Long, _
   ByVal FileID As Long, _
   ByVal FileVersion As Long, _
   Optional ByVal LatestSpecificBehavior As MFLatestSpecificBehavior = MFLatestSpecificBehaviorAutomatic, _
   Optional ByVal UpdateFromServer As Boolean = False _
) As String
Parameters
ObjID
The ID of the object containing the file.
ObjectVersion
The object version to target. Use "-1" for the latest version.
FileID
The ID of the file.
FileVersion
The file version. Use "-1" for the latest one.
LatestSpecificBehavior
ValueDescription
MFLatestSpecificBehaviorAutomaticAutomatically chooses the LatestOnly behavior (L folder) if the object version is the latest version. Otherwise, it chooses the SpecificOnly behavior (S folder). Only one location is ever returned when using this method.
MFLatestSpecificBehaviorLatestReturns a location in the L (Latest) folder only. (Otherwise the latest version is shown in both the L and S folders.)
MFLatestSpecificBehaviorNormalNormal behavior can return locations in both the L and S folders.
MFLatestSpecificBehaviorSpecificReturns a location in the S (Specific) folder only, even if evaluating the latest version.

If the target object exists with versions 1 and 2, the following table summarizes the L or S specific segments of the location path: 

Flag value Requested version 1 Requested version 2 Requested version -1

MFLatestSpecificBehaviorNormal

S/v1 L/L L/L

MFLatestSpecificBehaviorSpecific

S/v1 S/v2 S/v2

MFLatestSpecificBehaviorLatest

[error] L/L L/L

MFLatestSpecificBehaviorAutomatic

S/v1 L/L L/L

UpdateFromServer
True if the information should be always updated from the server.
Return Type
An absolute path of the specified object file.
Remarks

This method returns a non-volatile path to the object; the path does not change even if the object properties change. This is the recommended path for opening an object file in an application, or for storing the path.

This method is available only if M-Files API is used in the client interface mode.

See Also

VaultObjectFileOperations Object  | VaultObjectFileOperations Members