Hello Guys:
My question: I have an entity (salesorder) which has many entities related, but when I call the property: RelatedEntities, it doesn´t turn anything:
Please your help, to see if it´s ok, the following code:
protected static void copiarClonEntiRelacionadas(Entity entidadPadre, string nombreEntidadPadre)
{
try
{
RelatedEntityCollection a = new RelatedEntityCollection();
a = entidadPadre.RelatedEntities;
var d = a.Count;
foreach (KeyValuePair<Relationship, EntityCollection> entidadRelac in a)
{
string b = entidadRelac.Key.ToString();
if (b.Equals("order_details"))
{
foreach (Entity e in entidadRelac.Value.Entities)
{
string nom = e.LogicalName;
object obj = e.GetAttributeValue<string>("productdescription");
}
}
}
}
catch (Exception ex)
{
throw new Exception(ex.Message + "Clase: EntidadGenerica; Método: copiarClonEntiRelacionadas;\n");
}
}
thanks in advanced.
Roxana Cevallos Q. -PARTNER-