OnReadOnlyComponentNotify.LST script file

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Event Scripts > CADSystem >

OnReadOnlyComponentNotify.LST script file

Description

This script can take the control when the read-only component notification dialog is displayed because of an in-context modification of a read-only component.

Activation

Options→Environment

Input

@ACTIVE_DOCUMENT_UNIQUE_ID

the active document unique id

@COMPONENT_UNIQUE_ID

the read-only component unique id

Output

@OKSHOWDIALOG

0: don't display any dialog
1: display the standard notification dialog

@DIALOGTEXT

if not empty, and with @OKSHOWDIALOG=1, DBWorks will use the assigned text for the dialog prompt; the text lines must be separated by a vbcr (carriage return) character

@OKCHECKOUT

if 1, DBWorks will checkout the component

Example

.VBSCRIPT
sub main()
 DBWInit(TRUE)
 activeDocUid = DBWInput("@ACTIVE_DOCUMENT_UNIQUE_ID")
 componentUid = DBWInput("@COMPONENT_UNIQUE_ID")
 DBWMsgBox "OnReadOnlyComponentNotify" & vbcrlf &_
   "Active doc uid=" & activeDocUid & vbcrlf &_
   "Component uid =" & componentUid
 okShowDialog = 1
 okCheckout = 0
 if okShowDialog then
  text = _
  "COMPONENT: " & DBWQueryByUid( componentUid, DBWLookUp("NAME_FIELD_ID") ) & vbcr &_
  "STATE:" & DBWQueryByUid( componentUid, DBWLookUp("NAME_FIELD_STATE") ) & vbcr &_
  "Text modified from the sample script line #1" & vbcr &_
  "Text modified from the sample script line #2" & vbcr &_
  "Text modified from the sample script line #3"
  DBWOutput "@OKSHOWDIALOG",1,ForWriting
  DBWOutput "@DIALOGTEXT",text,ForAppending
 else
  DBWOutput "@OKSHOWDIALOG",0,ForWriting
  DBWOutput "@OKCHECKOUT",okCheckout,ForAppending
 end if
end sub