Hi all,
I have 3 Entities:
1. CContract (Many-to-One relation to CProductLine and CContractType)
2. CProductLine (One-to-Many relation to CContractType)
3. CContractType
I am in the Layout of the CContract Entity and when I am selecting a CProductLine (e.g. Insurances) under CContractType every ContractType that is related to the selected ProductLine should be selectable in the dropdown list. Is that possible? So based on the selected ProductLine the values under ContractType are filtered/visible.

I read something about a select-handlers and created the following.
/.../client/custom/src/handlers/select-related/contract-type-by-product-line.js
But that does not seem to work.
Thanks!
I have 3 Entities:
1. CContract (Many-to-One relation to CProductLine and CContractType)
2. CProductLine (One-to-Many relation to CContractType)
3. CContractType
I am in the Layout of the CContract Entity and when I am selecting a CProductLine (e.g. Insurances) under CContractType every ContractType that is related to the selected ProductLine should be selectable in the dropdown list. Is that possible? So based on the selected ProductLine the values under ContractType are filtered/visible.
I read something about a select-handlers and created the following.
/.../client/custom/src/handlers/select-related/contract-type-by-product-line.js
PHP Code:
define('custom:handlers/select-related/contract-type-by-product-line', ['handler'], function (Dep) {
return Dep.extend({
filterData: function () {
const productLineId = this.model.get('productLineId');
if (!productLineId) {
return null;
}
return [
{
type: 'equals',
field: 'productLineId',
value: productLineId
}
];
}
});
});
Thanks!