Can not retrieve Relations using API



I have a relation in my Content Type Definition. And I am trying to retrieve that relation using the following code

AttributedObject[] relatedProducts = ci.getRelations( "RELATION-ID" );

But I am getting the null value.

I also checked whether there are any relations available with


But that also returns an empty array.

Do I need to make any change in my CTD, so that the relation starts to appear to the API?


  • Qutubuddin

    Relation name is different from Field name, you seem to be using a field name and not Relation XML name.

    AttributedObject[] relatedProducts = ci.getRelations( <relantion-xml-name> );

    I hope this helps.