.NET Framework Class Library
Database.GetDocumentData Method

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > .NET API > MwPDMApi Namespace > Database Class > Database Methods >

.NET Framework Class Library
Database.GetDocumentData Method

Retrieves an object with all the data in the Document table for the specified document unique id.

Namespace: MwPDMApi
Assembly:  MwPDMApi (in MwPDMApi.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

Visual Basic

Public Function GetDocumentData ( _

uid As Integer _
) As Object

C#

public Object GetDocumentData(

int uid
)

Visual C++

public:

Object^ GetDocumentData(
int uid
)

JavaScript

function getDocumentData(uid);

Parameters

uid

Type: System.Int32
The unique id of the document

Return Value

A dynamic object which represents the entire row of the document table

Remarks

The returned object will have a property for each column in the Document table: the name of the property is the name of the column in the database.

Note that every column value is accessible via indexer too, with the column name as key.
Note also that the property name can be the real database column name, or the localization string NAME_FIELD_xxx: the conversion via LookUp is done internally.

Examples

For example, the following methods are equivalent for retrieving the documents' filename

 

Copy imageCopy Code

$doc = $app.Database().GetDocumentData($uid)

$fname = $doc.FILE_NAME

$fname = $doc.NAME_FIELD_FILE_NAME
$fname = $doc["FILE_NAME"]
$fname = $doc["NAME_FIELD_FILE_NAME"]

See Also

Database Class

Database Members

MwPDMApi Namespace