I have a checkbox field called Has_Key__c
that checks whether an employee has a key to the building or not.
I want to make a sum of all checked Has_Key__c
and compare it with a total number of available keys. There is a field that holds this total number, called Total_Keys__c
I want to output Total_Keys__c - Sum(Has_Key__c)
somewhere, preferably in a field as well.
What's the easiest way to do so? Formula? Apex? Rollup Summary?
Building__c
is a building,Key__c
is a key, andBuilding_Key__c
is a many-to-many object (master-detail toBuilding__c
andKey__c
, and a lookup toUser
, andHas_Key__c
field). Standard Rollups would work with this model, and a formula to express the remaining keys.