Occurs when a user clicks Apply or Close in the Meridian client applications for one of the pages listed in About the property page events except for the Document, Folder, and Import Packages pages (not editable). This event occurs once for every changed property value. If this event returns False, the corresponding grid cell on the Title Blocks property page is switched to edit mode and will wait for the user to modify the current value.
Syntax
<PageName>Page_CanApply(Context) As Boolean
Name | Description |
---|---|
Context |
A one dimension array that contains the layout name, block name, property name, old value, and new value as shown in the example. Read only. |
Remarks
If you use this event for the Retention or Rendition property pages, you do not need to show your own dialog box (WinMsgBox function) for validation errors. Instead, you can raise an error as in the following example, and it will be shown by the property page accordingly.
err.Raise vbObjectError, "RetentionPage_CanApply", "Invalid value for EXPIRATIONDATE"
You can also use this event to validate the property values that are mapped to attributes in the title blocks in multiple layouts of a drawing. The name of the event for the Title Blocks page is TitleBlocksPage_CanApply (no spaces). The DocGenericEvent_OnProperties event occurs after this event.
Example
Function TitleBlocksPage_CanApply(Context) If Not Document Is Nothing Then If IsArray(Context) Then Dim s s = "Layout = " + CStr(Context(0)) + ", " s = s + "Block = " + CStr(Context(1)) + ", " s = s + "Property = " + CStr(Context(2)) + ", " s = s + "Old value = " + CStr(Context(3)) + ", " s = s + "New value = " + CStr(Context(4)) If UCase(CStr(Context(4))) = LCase(CStr(Context(4))) Then TitleBlocksPage_CanApply = True s = s + ": VALID" Else TitleBlocksPage_CanApply = False s = s + ": INVALID" End If WinMsgBox s End If End If End Function