DBWQueryRevisionByUId

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Library Reference > Database >

DBWQueryRevisionByUId

Description

Given the identifier of a DBWorks document, it fetches from the REVISION table of the DBWorks database the value of an assigned field.

Syntax

Function DBWQueryRevisionByUid(Uid, Revision, FieldName)

Parameters

Uid

unique id of the document

Revision

revision you want to fetch values from

FieldName

Identifier of an existing field in the REVISIONS table of DBWorks

For writing portable scripts across different localizations of the database, may be better to declare fields using the DBWLookUp function, that accepts as argument an identifier of a standard field.

A list of the available identifiers for standard fields follows below:

NAME_FIELD_DESCRIPTION

NAME_FIELD_CREATED_BY
NAME_FIELD_CREATION_DATE
NAME_FIELD_LAST_MODIFIED_BY
NAME_FIELD_LAST_MODIFIED_DATE
NAME_FIELD_APPROVED_BY
NAME_FIELD_APPROVAL_DATE
NAME_FIELD_EFFECTIVE_FROM_DATE
NAME_FIELD_EFFECTIVE_FROM_DATE
NAME_FIELD_NOTES
NAME_FIELD_UPDATE_STAMP

Return Values

After calling this function check the boolean value of the okDBW variable:

TRUE

if succeeded in fetching the value

FALSE

otherwise

If okDBW is TRUE, the function returns the requested value.

See also

Function DBWQuery
Function DBWQueryByUid

Example

docUId = 24
fCreatDate = DBWQueryRevisionByUid( docUId , "2", "CREATION_DATE" )
if (okDBW = False) then exit sub