Is there any way to add server event listener for export?
In this case, I must manage all forms separately to decide whether to export captions or not. Therefore, I have defined a flag, and I want to export the caption versus the field name for all forms when the flag is set to true.
You may simply use Page_Load server event, for example, in List Page:
// export field caption
$this->YourFieldName->ExportFieldCaption = true; // adjust YourFieldName to your actual field name
// disable export field caption
$this->AnotherFieldName->ExportFieldCaption = false; // adjust AnotherFieldName to your actual field name
This way I have to write this for every form and every field. I want to control it centrally through the AddListener , Event Listeners with this command:
It depends on under what conditions that you need to change the setting. If you can determine independent of pages or users, you may simply set Config("EXPORT_FIELD_CAPTION") globally (for all tables/fields) in Global Code.