Add search_by for linked items
You can retrieve linked items and make links between items but you can't currently search by them. Example. Org Units may have many linked Locations. You may want to search by Org Unit's who are linked to a specific location.
At the moment an example search is:
get_by({'Name':'Some Org')
The parameters you specify are only linked to the main object.
This library needs a way to search by a linked object.
idea 1 - Using existing param field with a special . notation
org_unit.get_by({'AC_OUAssocLocation.Location.Name':'Some Loc'})
This would require some inferring of logic and relationship. A business object can have multiple objects so you would have to include the relationship name in the notation. This would then need parsing.
idea 2 - Using existing link parameter
Modify the list of relationships to bring back to include some customization of parameters.
get_by({'Name': 'My Org Unit'}, links=[{'AC_OUAssocLocation':{'Name':'Some Location'}], limit=500)
The main disadvantage is when get_by is expanded to allow AND/OR searching it'll be tough to AND/OR based on two sets of parameters.
idea 3 - Combine 1 & 2
If we want to specify a relationship based field in the params field, then we must have a corresponding matched relationship link. This would allow the get_by search to verify the relationship exists before doing anything.
get_by({'Name': 'My Org Unit', 'AC_OUAssocLocation.Location.Name':'Some Loc'}, links=['AC_OUAssocLocation'], limit=500)
We would still need to parse the parameters in get_by to see if a relationship exists but we now have a dictionary to start from. We used links to check for matching prefixes.