Take Demographics table as a main Layout and enter all requirment field.
On this layout call add question and answer table Layout.
When click on "add question/answer" just go to that layout and make sure the person's ID must copied to that table and paste it by creating new record .
relationship should be
questionID=fkquestionID(in Answer table)
From the both relation ship just bring 2 portal and
I think u must see all the values for one related record in person table.
Here's a simple script for creating a new related record. It does not use copy and paste as that can destroy data your user may have previously copied to the clipboard for other uses:
Set variable [$key ; YourParentTable::PrimaryKey ]
Go To layout [Child Table Layout]
Set field [Child Table::ForeignKey ; $Key ]
Go To Layout [original layout]
Copy and paste script steps also silently fail to work if the fields they reference are not present on the current layout. Set field will still work as long as the correct layout is current at the time it executes.
Thank you both!
The basic concept that one needs to explicitly, through a script, create related fields was a big point I needed to understand.
I was hoping for some further clarification (which speaks to your point Atuf). It seems to me that my intermediate table (Answer table) would be more clear if it was set up the way I first described it. Three columns-the first two are simply id numbers (foreign keys) that refer to the person and the question, and the third column to the answer.
Why are you putting the foreign keys in DIFFERENT tables?
Was that a typo , or am I missing the point....again?
i am here describing the whole concept.
You need to enter person information in person table.
For each person you want to set up question and for each question there should be answer .
So to relate all the above three table
1>person must be relate to question by ID
2> answer must be relate to question and person
Another thing you need to set the ID field in other table it may be by foreign Key or anything
but foreign key is good for understand.
I think you want this so pls proceed ..........
The basic concept that one needs to explicitly, through a script, create related fields [Records] was a big point I needed to understand.
You don't always have to do so explicitly, nor do you have to use a script in every case. It depends on the design of your system.
If you have "Allow creation of records via this relationship" enabled for the relationship between two tables, a single script step:
Set Field [RelatedTable::field ; //put expression here ]
Can create a related record if a related record does not already exist.
Even without a script, manually entering/selecting data in an empty field can create a new related record if this option is enabled for the relationship.