Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > building custom document fields from other custom document fields View modes: 
User avatar
Member
Member
Tom - 9/11/2011 11:52:43 AM
   
building custom document fields from other custom document fields
I am most familiar with rules based systems where you define rules for a record & the system will fire those rules any time a record of that type changes. This allows for behind the scenes building of fields that the user does not see on an input form.

Let's say I have 2 fields:
- Date
- Description

And want to build a 3rd field which appends Date & Description field and is not displayed on the input / editing form:
- Event Information

I am hoping that this solution will enable Event Information to be updated automatically any time a user makes a change to the record in question.

I realize that in this simplified example, Event Information could be displayed in a transformation without calculation & being stored in the record. My use case is more complicated & I would like to store the calculated data directly in each record.

Could you provide a detailed example of how this could be accomplished?



User avatar
Member
Member
kentico_michal - 9/11/2011 10:58:16 PM
   
RE:building custom document fields from other custom document fields
Hello,

You can take advantage of using CustomTreeNodeHandler class that allows you to execute custom code when some CMS Event occurs (document is created, updated, deleted).

You can access the TreeNode class which represent a given document, access all its properties and update the Event information field if necessary.

For more information I would like to point you to the following articles:
Event handling overview, Treenode handler, Content management internals


Best regards,
Michal Legen