Passing foreign key correctly when creating a children in page of parent

This is my setup: A task can have many progress report and a report belongs to one task.

In my task edit page, i set up a form add new:


When i create a progress report, i want it to have a new pkey, and the foreign key task_id of the in state selected task. But it seems like when i create a new child, nocobase assigns the instate task id to the progress report id (the task in the screenshot has id 2)

I also tried to assign the new progress report’s id and foreign key task id from the assign field option in the submit button of create new report, but i cannot access the in state task information:

Does anyone have experience with this? thanks

Hi, this “Foreign Key” should be “task id”

Hi shleyZ, thanks for the response. I did as you suggested, but it still does not work. I even recreated the other association link in task, cleared my cache, restarted my app, but still face the same error. Maybe because it’s just a naming convention and doesn’t impact the logic?

.
This taskID field was automatically created in task, but it doesn’t specify that it’s a foreign key referencing task. This is correct?

By examining the schema for progressReport in sql, I see that my reportID is the PK.


But same issue still persists when creating a report assigns the taskID to the progress Report ID. I see that there is no foreign key constraint in the sql schema, but the same applies to the other relations, so I’m guessing the constraints are enforced in the backend logic?

Do you know why? And how I can fix this? Thank you

Still unsolved