Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to Link Child Record to Parent Record When Adding a New Record #1758

Open
KoamSK opened this issue Apr 11, 2024 · 2 comments
Open

Failure to Link Child Record to Parent Record When Adding a New Record #1758

KoamSK opened this issue Apr 11, 2024 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@KoamSK
Copy link

KoamSK commented Apr 11, 2024

I can't get a child record to be linked to parent record when adding a new record.
The old modules and pages works perfectly.
Version : 2023.9.5

Steps to Reproduce:

  1. Create a parent module named "a1" with a field named "parentName" of type string.
  2. Create a child module named "a2" with fields "childName" (string) and "parentID" (record selector) referencing module "a1".
  3. Create a record page for the module "a1" and add a record list block for the child module "a2" with a prefilter condition: "parentID = ${recordID}".
  4. Create a record page named "a2".

Expected Behavior:
When adding a new record within a record of module "a1" by clicking "+Add" in the record list block for module "a2", the new record in module "a2" should automatically inherit the parentID field value equal to the parent's record.

Actual Behavior:
Upon adding a new record in module "a2" from within a record of module "a1", the parentID field in the new child record remains empty, failing to establish the expected link to the parent record.

Additional Information:
In the documentation, there is no clear steps talking about linking parent modules to child modules. I used keywords like "linking" "parent", or "child" but I didn't succeed.

a1
a2

@Fajfa Fajfa added this to the 2023.9.x milestone Apr 12, 2024
@Fajfa Fajfa added the bug Something isn't working label Apr 12, 2024
@katrinDY katrinDY assigned kelanik8 and katrinDY and unassigned kelanik8 Apr 12, 2024
@katrinDY
Copy link
Contributor

This is an edge case that will be addressed in 2024.3.x. For now to avoid this, I would recommend creating a record page and then a record list page for module a1, doing the same for a2, and after this adding page blocks to the desired pages. I would delete the currently broken pages and follow the steps in the previous sentence.

@katrinDY
Copy link
Contributor

katrinDY commented Apr 16, 2024

Reproduction steps

Image

Notes

2 issues

  • if a1 module and a2 are linked via field => a1 rec page is created and a RL pointing to a2 is added => a2 rec page is created => rec page of a1 becomes the parent of rec page 2

  • if RL page is created for a1, then the hierrarcy is: RL a1 is the grandparent of a1 rec page, a1 rec page is the parent of a2 rec page. This makes sense. If the first issue is fixed, then this shouldn't be a problem

  • update: you don't have to select a reference field. You just:

  1. create module a1 with string field
  2. create module a2 with string field and rec field (don't add any configs)
  3. add rec page for a1 with RL pointing to a2
  4. add rec page for a2 and a1 rec page is the parent of a2 rec page
  • another update: this is present on 2022.3.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants