cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Capture Events on properties/propertypages

SVanSchoonlandt
Honored Contributor

Is it possible to capture events on the properties of an object?

 

I would like to trigger additional processing when a user either changed something in the properties of an object or when he clicks on the Ok/Apply buttons. When he clicks on these buttons, I would like to perform some cross-field validations and inform him of a not allowed combination of entries and force him to correct his update (or if he does not want to correct them, force him to hit the cancel button and rollback his changes).

3 Replies

lionel,

 

interesting tip! I'm going to have a go at what you explained.

 

Thanks

 

stijn

lmazurie
Honored Contributor

Hello Stijn

 

As a basic "Tips and Tricks" for this kind of a thing I am usually creating a dedicated Modeling Rule (and Modeling Regulation if needed) with a macro attached , then when pressing OK-Apply, the rule is activated, an hidden treatment can be made, a window / msgbox  displayed for users to explain why he cannot enter this value, a cancel of the value of an attribute can be made with dedicated API to clean it or transform it (to capital letter if it is the rule ...) , I think the property dialog window can be canceled then (to check because I know how to open it by API). So with the macro of the modeling rule everything is open.  

With options you can hide both in the explorer and diagrams the display of the level of rules compliancy so this mechanism is totally hidden for a final user.

 

Lionel Mazurié

jhorber
MEGA
MEGA

Hello Stijn

 

If I understand, you want to trigger specific code when clicking on the OK/apply button in the property box.

This is not a feature of the MEGA Destkop platform in version MEGA 2009.

 

When updating a specific property (MetaAttribute, TaggedValue, MetaAssociationEnd with uniqueness constraint), it is possible to trigger specific code. Such macros are called 'UpdateTool' macros

Run the following queries to see examples in the demonstration environments:

Select [MetaAttribute] Where [MetaAttributeUpdateTool].[VB Script] Not Null

Select [TaggedValue] Where [_ParameterUpdateTool].[VB Script] Not Null

Select [MetaAssociationEnd] Where [_LegUpdateTool].[VB Script] Not Null

Jerome