I have a custom module "Clients" with a related custom module "Family" , I want to add a field to the Clients module that "counts" the total number of records in the "Family" related to each client.
I believe that you would want to use the count() formula as a calculated field. For example if you wanted to find the count of the number of calls related to a record, you would go to the field in Studio, tick the calculated value checkbox, and enter the following as the formula: count($calls)
Similar syntax would be used for your goal of counting the number of families related to a client. Once you have added the field in Studio (it should probably be a number field) you can make it calculated and enter a formula that would be something like: count($families)
Note that with a calculated formula, a save action is required for the field to update. You can read more about this at: http://support.sugarcrm.com/Knowledge_Base/Studio_and_Module_Builder/Sugar_Logic/Introduction_to_Calculated_Fields/index.html#Updating_Calculated_Field_Formulas
Thanks for this Patrick but it looks like the "Calculated Value" tickbox is not available on field types in Community Edition.
Retrieving data ...