Cannot create Entity Instance, when using the withAfterCloseListener

hi,
I am calling other editor screen from an editor screen using the screenBuilders. The other editor screen returns the entity correctly to the current editor screen. But when i commit my currrent editor screen. I am getting the following error.

EntityValidationException: Entity com.company.pnptp.entity.Actor-ea7372b2-d2cd-032d-1a52-1510ba2fd5ab [new] validation failed.

My actual code is shown below…


    @Subscribe("responsibleManagerField.actorPickAction")
    protected void onResponsibleManagerFieldActionPerformed(Action.ActionPerformedEvent event) {

        screenBuilders.editor(responsibleManagerField)
                .withScreenClass(ActorEdit.class)
                .withAfterCloseListener(actorEditAfterScreenCloseEvent -> {
                    ActorEdit actorEdit = actorEditAfterScreenCloseEvent.getScreen();
                    if(actorEditAfterScreenCloseEvent.getCloseAction().equals(WINDOW_COMMIT_AND_CLOSE_ACTION)) {
                        Actor actor = actorEdit.getActor();
                        responsibleManagerField.setValue(actor);

                        responsiblemanagerDc.setItem(actor);
                        responsibleManagerField.setValue(actor);

                    }
                })
                .build()
                .show();
    }

Hi,
If you think that it’s incorrect, provide a test project where we could reproduce the problem.