Hi,
I trying to add some custom conditional fields visibility in the documents module. In the developer documentation section, I found this tutorial that seem to be exactly what I try to do : Adding Custom Field Logic :: SuiteCRM Documentation
The logic extension.
So I created the conditional field and some testing field with Studio, then added a new blank file in public/legacy/custom/Extension/modules/Documents/Ext/Vardefs/_add_documents_type_field_logic.php
and finaly add this code :
//this is to be sure that my changes are applied, after the repair and rebuild hit :
$dictionary['Document']['fields']['t1_champ1_c']['default'] = "hello world 3";
//this is the logic statement, from the topic. As I anderstand, if the field "type_c" is setted to "piece_id", the field "t1_champ1_c" has to disappear.
$dictionary['Document']['fields']['t1_champ1_c']['logic'] = [
'display'=>[
'key' => 'displayType',
'modes' => ['detail', 'edit', 'create'],
'params' => [
'fieldDependencies' => [
'type_c',
],
'targetDisplayType' => 'none',
'activeOnFields' => [
'type_c' => [ 'piece_id']
]
]
]
];
the default value is well setted, but the logic described in my comment donât work. Do I missing something?
The type_c field is a simple choice list type.