Undesirable documents are showed in binding overview when editing relationship

I’m using cdm in A12 2023-06-ext5.1
In my example, I have the relationship (1)Employee ↔ (n)Contract. When I editting contract for employee, in the Available Elements overview it shows all of the contracts I have in database, even most of them already be linked to other employee. In my expectation, the contracts which has been linked to other employee should not be displayed in the list, it should only show the contract which linked with current employee.

If I select the contract which belongs to other employee, I do received the error: “Upper Limit Reached. Upper limit reached for role [EmployeeRole] in relationship model [Employee_Contract_RM]”

Please see the attached pictures for more details.


What should I do to solve it? Thank you!

hey @nguyen-sharp-drift
It is currently not possible to circumvent this behavior for regular Bindings. We filed a requirement (A12-15676) to tackle this topic. Please add your usecase to the ticket (and your project as trigger).

But since you are in a CDM, you could change the user flow, so that it is only possible to add contracts to the list (Table List + Has Edit Modal = False). This brings the creation of the contract in direct context to the employee (it should then not be possible to create a contract anywhere else.)

Hi @felix-blazing-river ,
When I set 'Has Edit Model = False), now it’s only possible to add contract. But how can we delete the contract? is it possible to add the delete button for each row in the binding overview?

Deletion would currently not be possible. (But would neither be in the other Binding. In the other Binding the end user could unlink → but what would be the use case of having an unlinked contract?)

Is deletion of an existing contract something that should be possible in this use case? For better audit-ability it is probably good to keep all the previous contracts and just mark them as inactive (or put start + end dates in them)

Hi @felix-blazing-river ,

  • User can create a draft contract, and then delete that draft version if something got changed in between. Above is just one of the usecase, we do have similar case in other scenario where user putting data and then delete them if it’s not necessary or valid anymore.

In order to do that you would have to customize the Binding, which is currently not supported by a public API.

You could do this workaround: Create a CDM Contract + Linked Employee, make an overview on it. In this overview you see all the contracts with the respective Employees. You can delete Contracts there.

(You could make a Custom “Delete a Contract” button on your Employee form, that opens this overview in a new activity and sets a preset filter, so the enduser only sees the contracts of the Employee she/he was just looking at)

Hi @felix-blazing-river, thanks for your answer. For now I think I will add a delete button inside contract details form.