I have an extension with a main table with a checkbox which should not be available if the item already has a relation through an MM table, the relative TCA :
'checkbox' => [
'displayCond' =>'FIELD:uid:!IN:SELECT uid_foreign FROM tx_myext_object_object_mm',
'exclude' => 0,
'label' => 'checkbox',
'config' => [
'type' => 'check',
'items' => [
'1' => [
'0' => 'LLL:EXT:lang/locallang_core.xlf:labels.enabled'
]
],
'default' => 0
]
],
can this syntax be corrected or is it impossible (this snippet does not work)
Since TYPO3 7.6 userFunc is available as display Condition.
In your case I recommend for your TCA configuration:
And a PHP class named DisplayConditionMatcher.php located in your extension EXT:myext/Classes/ with following content:
You can pass additional parameters separated by colon for displayCondition of type userFunc, as described in TYPO3 CMS TCA Reference. For example negation, as already implemented in PHP class:
Adapt names for extension, path and vendor that matches your needs.