Customization possibilities

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

This topic provides information on how BizForms behavior can be modified with your custom code.

 

Event Handling

 

You can run custom actions when a BizForm form record is created, updated or deleted. There are two ways how you can handle these events:

 

1. Handling BizForm control events

 

In this case, you place the BizForm control on a user control or web part and specify a code name of the required BizForm in its FormName property. Then, you can handle the BizForm events, such as OnAfterSave, OnBeforeValidate, etc.

 

In these handlers, you can access form values using the BizForm.BasicForm.DataRow property and stop further processing (saving) of the form using the BizForm.StopProcessing property. Particular fields, labels and validation error messages can be accessed using the BizForm.BasicForm.FieldControls, BizForm.BasicForm.FieldLabels and BizForm.BasicForm.FieldErrorLabels properties.

 

Example of this type of customization is located in Development -> Web parts -> Modifying web parts -> Modifying code of standard web parts.

 

2. Handling global data events

 

You can write a custom data handler as described in the API programming and Kentico CMS internals -> Data handler (CustomDataHandler class) topic. Such a handler will allow you to run custom code whenever a database record is inserted, updated or deleted. You can use the dataItem.ClassName property to check if the record being updated is your BizForm code name (you can find it in the Form code name field on the General tab of a form's editing (Edit) interface).

 

Custom Field Controls

 

You can create your own field controls as described in chapter Form controls. If you want to make them available in the BizForms field editor, you need to check the box Show control in BizForms in the Form control properties dialog (in Site Manager -> Development -> Form controls) and choose the default data type.

 

Page url: http://devnet.kentico.com/docs/5_5r2/devguide/index.html?api_bizforms_customization_possibilities.htm