I thought I was getting the hang of ORDA but now not so sure. I’m getting error when I’m trying to access an undefined property.
So my case I have two tables litters and dogs. A dog can be a mother or father so I have relations for both. All works very well when I have a mother and a father. However for a new record where the foreign key is not assigned I’m getting errors using the relation attribute.
$litters:=ds.Litter.query("CompanyID =:1";comp.UUID) // get litters For each ($element;$litters) APPEND TO ARRAY(LitterMother_at;$element.MotherToLitter.Name) APPEND TO ARRAY(LitterFather_at;$element.FatherToLitter.Name) End for each
So in this case I have created and saved a litter record but when I loop through the entities MotherToLitter.Name returns undefined. This seems confusing because the attribute is not undefined just dont have an entity loaded.
I need to use array as this is for a web page. What’s best practice in this situation ?