SuiteCRM V8 API Wrapper in Python get relationships

As described in my previous post I have written a small Python wrapper for the SuiteCRM V8 API. You can find the source code on Github.

The initial version is now extended to be able to fetch data for relationships. E.g. if you have an opportunity there are (typically) always contacts assigned to it. With this feature enhancement you can now get these contacts for the opportunities.

The method to use is called get_relationship_data and has 6 parameters:

  1. module: The base module for the relationsip (e.g. opportunity)
  2. id: The id of the element to fetch the relationships for
  3. relationship: The relationship modle (e.g. contacts)
  4. fields: The fields to fetch (can be None)
  5. filter: The filter to set (can be None)
  6. pagination: The pagination information (can be None)

You can use it like this:

suite_crm_service.get_relationship_data(Module.OPPORTUNITIES, id, Module.CONTACTS)