Data Manager customization: preRenderCloneRecordForm
Data Manager customization: preRenderCloneRecordForm
The preRenderCloneRecordForm
customization allows you to add rendered HTML before the rendering of the core clone record form. The HTML will live inside the html <form>
tags, so that you are able to add form fields into the form.
The handler is expected to return a string that is the rendered HTML and is provided the following in the args
struct:
objectName
: The name of the objectrecordId
: The ID of the record being cloneedrecord
: Struct of the record being cloneedcloneRecordAction
: URL for submitting the formdraftsEnabled
: Whether or not drafts are enabledcanSaveDraft
: Whether or not the current user can save drafts (for drafts only)canPublish
: Whether or not the current user can publish (for drafts only)cancelAction
: URL that any rendered 'cancel' link should use
For example:
// /application/handlers/admin/datamanager/faq.cfc
component {
private string function preRenderCloneRecordForm( event, rc, prc, args={} ) {
return '<p class="alert alert-warning">Remember: double check existing records before adding a new FAQ.</p>';
}
}
See also: postRenderCloneRecordForm