How do hierarchy relationships work?

Posted by romain.pennes@foederis.fr on 16-Sep-2016 09:18

Hello,

It is possible to create a hierarchy relationship.
For example Employee ==> Employee.

The hierarchy relationship is 1 to many.
We use it to have manager / collaborators.

When doing a rbv_api.getRelatedIds("relname", employeeId);
Does the getRelatedIds returns the 'children' or the 'parent' of this relationship?
(Since there is only one relationship for bot directions - manager and collaborators)

Thank you for your answer.

Posted by Shiva Duriseati on 21-Sep-2016 05:25

Hi Romain,

The API rbv_api.getRelatedIds("relname", employeeId); returns parent ID which is always a single record.

Alliterative way is to use rbv_api.getFieldValue which returns array of record Id's associated with parent.

Example:

var childIds=rbv_api.getFieldValue("ObjectName", empID, "collaborator");

for(var i=0;i<childIds.length;i++){

  rbv_api.println(childIds[i]);  

}

Regards,

Shiva

All Replies

Posted by Shiva Duriseati on 21-Sep-2016 05:25

Hi Romain,

The API rbv_api.getRelatedIds("relname", employeeId); returns parent ID which is always a single record.

Alliterative way is to use rbv_api.getFieldValue which returns array of record Id's associated with parent.

Example:

var childIds=rbv_api.getFieldValue("ObjectName", empID, "collaborator");

for(var i=0;i<childIds.length;i++){

  rbv_api.println(childIds[i]);  

}

Regards,

Shiva

This thread is closed