I need to add some custom JS for fields in QuickCreate form in custom module. I tried to create views/view.quickcreate.php
file in which I extended ViewQuickcreate class. But it looks like this doesn’t work since Xdebug could not hit breakpoint installed inside overridden display(). Any ideas how to override default view for QuickCreate?
Oh, it looks like we need to name view file as view.subpanelquickcreate.php
and the view class name should be SubpanelQuickCreate
What class did you extend your SubpanelQuickCreate?
This is what I have and it is working. The file is in custom/modules/Cases/views/view.subpanelquickcreate.php
<?php
require_once('include/EditView/SubpanelQuickCreate.php');
class CasesSubpanelQuickCreate extends SubpanelQuickCreate
{
public function CasesSubpanelQuickCreate(){
?>
<script>
$( document ).ready(function(){
alert('hello');
})
</script>
<?php
parent::SubpanelQuickCreate("Cases");
}
}
I am trying to pull parent name (contact name) into my custom field with this extension however I am unable to get it. Can someone give me a hand with this. As of now im just getting parent_name_advanced in my field.
<?php
require_once('include/EditView/SubpanelQuickCreate.php');
class CasesSubpanelQuickcreate extends SubpanelQuickCreate {
public function CasesSubpanelQuickcreate() {
$_REQUEST['contacts_cases_1_name'] = 'parent_name_advanced';
parent::SubpanelQuickCreate("Cases");
}
}