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?
Thank you for reply. Yes I did : to be sure I set the default key every time I make a change and I can see the change, the default value of the field is updated (see my code).
The following code block shows an example of the configuration we need to add to the vardefs in order to get the logic described on the previous section
I am quite unsure about how to do this for SuiteCRM 8. The docs are not clear about using âLogicâ as a key in the fieldâs dictionary⌠Those ââŚâ in the docs are really mysterious
Yes, while the Documents module is on âclassic viewâ mode you need to the change in a legacy way.
Following the suggestion @BrozTechnologies made may be an option, depending on your requirements.