Hi Daniel!

Thank you for you help. I got your explanation but my question may be very poor about what I was expecting. 

Considering the same classes that you mentioned above, from SAMPLES (Sample.Company and Sample. Employee) I ran the following code:

USER>zn "samples"
 
SAMPLES>set c = ##class(Sample.Company).%OpenId(1)
 
SAMPLES>w c
1@Sample.Company
SAMPLES>w c.Name
PicoPlex Gmbh.
SAMPLES>w c.Employees
2@%Library.RelationshipObject
SAMPLES>w c.Employees.Count()
5
SAMPLES>w c.Employees.GetAt(1)
3@Sample.Employee
SAMPLES>w c.Employees.GetAt(1).Name
Thompson,Vincent L.
SAMPLES>w c.Employees.GetAt(2).Name
Garcia,Amanda C.
SAMPLES>w c.Employees.GetAt(3).Name
Noodleman,Barbara T.
SAMPLES>w c.Employees.GetAt(4).Name
Smith,Dick A.
SAMPLES>

From the result above you can notice that the employee names, for instance, is not ordered. My question was about choose the order by name, salary or any other property value from the "child class". Is it possible? What would be an alternative for that?

 

PS: I also have tried to use SetObjectAt method and pass a key parameter value with the value that I want to be ordered. However when I try to retrieve data by using thoses key values, it does not work according to the key order that I tried to use on SetObjectAt key parameter value.

Thanks.