Some questions to the result of running the following script:
Relation = Model.AddLinkObject(2004, TenantEntity, Entity);
Relation.Name = RelationName;
Relation.Caption = RelationName;
Relation.Identifying = false;
Relation.MandatoryParent = false;
Attribute = Relation.ForeignKeys.GetObject(0).AttrChild;
Attribute.Name = AttributeName;
Attribute.Caption = AttributeName;
Attribute.Ordinal = 2;
Attribute.NotNull = false;
Pk = Entity.Keys.GetObjectByName(Prefix+’_PK’);
if (Pk == null) {
System.ShowMessageDialog(1000,‘AdaptEntitiesDialog’,‘Could not find PK ‘+Prefix+’_PK’,3,4);
}
else {
// Remove from Pk.KeyItems
}
-
How to prevent the new attribute being added to the primary key?
-
Or as workaround: How to remove an item from the KeyItems list?
3.Why is the new FK attribute always at the bottom and Attribute.Ordinal=2 ignored? How to move it up to the second position inthe script?
Thanx a lot.
Andreas