Custom editviewdefs (not changing default, need adding new editviewdefs2.php for example)

I want use condition to get different editviewdefs.

Now I trying to get custom editviewdefs using information that I found in internet.

    

function preDisplay(){
        TemplateHandler::clearCache($this->module,'EditView.tpl'); 
        $metadataFile = 'modules/daeec_documents/metadata/editviewdefs2.php';
        $this->ev = $this->getEditView();
        $this->ev->setup($this->module, $this->bean, $metadataFile, 'include/EditView/EditView.tpl');
}

but it does’t work :frowning:

May be somebody used this functionality and can help?

Thanks.

I found this solution, it helps me:

http://stackoverflow.com/questions/20116093/conditionally-make-a-field-readonly-in-sugarcrm