Add default values to EntityObject properties

Vote:
 

I have created the MetaClass and added a UI for it in CommerceManager, I can add new objects but I need to set default values to some of the string properties.
For instance, I want to set the current user name for the property CreatedBy.

My idea to do this is by using MetaClass triggers, but I can't get them to fire.

I have managed to create and added the trigger to the MetaClass, see the included meta information taken from the column mcmd_MetaClass.XSAttributes for my custom MetaClass:



 
    Triggers
    Mediachase.BusinessFoundation.Data.Meta.Management.Trigger[], Mediachase.BusinessFoundation.Data
   
     
       
          trg_SetDefaultValues
         
          true
          true
          true
          TriggerAction
         
          TriggerAction
         
       

     

   

 



My MetaClass contains a public method named TriggerAction but it is never called.

What am I doing wrong?
Is there any example code on how to use MetaClass triggers?

#152088
Aug 16, 2016 10:06
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.