Looking to get a count of specific field based on conditions.
Table 1 = Contacts
Table 2 = Phone Numbers (related table)
Table of Phone numbers has a field of phoneType ("Office","Cell","Fax" etc)
I would like to count the number of related records with a condition that says if ( phoneType="Cell") or something like that and than take action based on what the count is. I don't need the count of all related records for that table, just the ones that match the condition.
I know I can get the Count of related records using the Count() script and/or do a summary field. This will all be done on a script trigger of on modify on the drop down when the user changes the phoneType in a portal from the layout of the Contacts.
My main question or obstacle is I am not sure how to incorporate the condition in the count, I only know how to count all related records.