Hi!
I have problem with unique values in table.
I have 2 tables:
Parent Table:
table 50900 ParentTable
{
Caption = 'Parent Table';
DataClassification = ToBeClassified;
fields
{
field(1; "Parent No."; integer)
{
Caption = 'No.';
DataClassification = ToBeClassified;
}
field(2; "Parent Name"; Text[10])
{
Caption = 'Parent name';
DataClassification = ToBeClassified;
}
}
keys
{
key(PK; "Parent No.")
{
Clustered = true;
}
}
}
Child table:
table 50901 ChildTable
{
Caption = 'Child table';
DataClassification = ToBeClassified;
fields
{
field(1; "Parent No."; Integer)
{
Caption = 'Parent No.';
DataClassification = ToBeClassified;
TableRelation = ParentTable."Parent No.";
}
field(2; "Child Name"; Text[20])
{
Caption = 'Child Name';
DataClassification = ToBeClassified;
}
}
keys
{
key(PK; "Parent No.")
{
}
}
}
I want relation between this two tables one-2-many : ParentTable-2-ChildTable.
When I try to insert second record to ChildTable i get error "
The record in table ChildTable already exists. Identification fields and values: Parent No..='1'.
I think that problem is with key on child table. I tried to set property Unique = false, but it didn't help.
Record in tables should look like this:
PARENT:
1;John
2;Emily
CHILD:
1;Emma
1;Lily
2; Steve
2;Patrick
Any solutions?
Best regards.