Question about using the rest API with related records

Hello,

I have successfully been able to create related records using the /<module>/:record/link/:link_name POST endpoint.

And I have successfully been able to list all of the related records to a specific record using the /<module>/:record/link/:link_name GET endpoint.

However I have not been able to find in the documentation a way to list all of the related records between two modules?  Say that I wanted to retrieve all of the links between accounts and projects.  How would I be able to do that?

Thanks.

Bryan Hunt

Parents Reply
  • Jeff, 

    Thanks for the response.  But this isn't quite what I was looking for.

    I want to see the actual link records for every account that is linked to a project.  Somewhere there must be a table of all record linkages?

    Thanks.

    Bryan Hunt

Children
  • Hi Bryan,

    I believe you'd like to retrieve the Many-To-Many record that ties 2 modules together huh?

    The underlying structure of tables is all handled by Sugar and there's no API for it, you could definitely write your own Sugar Query for that but I'd like to understand your requirement first. 

    It's very unusual for you to manipulate that join table yourself other than the following methods:

    Please share your requirements with us, perhaps there's a better way of doing this:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    GET /<module>/:record/link/:link_name | Retrieve a module's records related to another
    module's record
    POST
    /<module>/:record/link/:link_name/:remote_id | Relate a module's record to another module's
    record
    DELETE
    /<module>/:record/link/:link_name/:remote_id | Delete a relationship between two module’s
    records
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    rafa

    Rafael Fernandes

    Staff Developer Advocate | SugarCRM