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:
- module: The base module for the relationsip (e.g. opportunity)
- id: The id of the element to fetch the relationships for
- relationship: The relationship modle (e.g. contacts)
- fields: The fields to fetch (can be None)
- filter: The filter to set (can be None)
- pagination: The pagination information (can be None)
You can use it like this:
suite_crm_service.get_relationship_data(Module.OPPORTUNITIES, id, Module.CONTACTS)