I have been Trying to Decipher the Reference Guide to try to help me write a Jscript which would allow me to Generate a Report
I know how to Iterate Entities and within Entities to Iterate the Attributes
And I Can discover in my iteration of the Attributes that I can use the Field Attribute.CountParentAttributes and if it is > 0 then I know it is a Foreign.
However, I want to for a Entity/Attribute which is a Foreign key list the Parent Entity/Attriubute
So I can Iteration ALL Relationships in My Model using this in order to Produce a Report
var app = System.GetInterface(‘Application’);
var Model = app.Models.GetObject(0); // first model in Application View
var r,a, Relation,Foreignkey, Parent_Attributes, Child_Attributes;
for (r=0; r<Model.Relations.Count; r++)
Relation = Model.Relations.GetObject®;
for (a=0; a<Relation.ForeignKeys.Count; a++)
if (a == 0)
Log.Information(“Relation = “+Relation.Name+” Parent= “+Relation.ParentEntity.Name+”(”+Parent_Attributes+")"+" Child= “+Relation.ChildEntity.name+”("+Child_Attributes+")");
But I would like to know what is the Most Efficient way to Go from Entity/Attribute which I know is a Foreign key (Aka it is the Relation.ChildEntity.name and one of the Attributes of that relations Relation.ForeignKeys.AttrChild.Name in order to on the Same line as the Entity/Attribute produce the Parent Entity Name and its Attribute Name (Aka the Relation.ParentEntity.Name and the Foreignkeys.AttrParent.Name)
Is there a Method to do that (like Relations.GetSomething(parentname,childname) without Creating a Internal Array of All Parent/Child Attribute lists and Scanning it every time.
Please let me know.