function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sssssssssssssssssssssss ssssssssssssssssssssssss s 

How to restrict the count of contacts based on the role field in contact?

Hi Team,

I have a contact object whose "Role" field can be any of the 10 values, 'A' thru 'J'. The contact object has couple of other fields namely Branch Name and Sub-Branch Name.

How do I ensure that for a Sub-Branch Name field there are no more than X number of contacts?

Depending on the Sub-Branch, I should be able to change the value of the "X" i.e. the number of contacts.

What is the best way to achieve this?

Many Thanks in advance for all your help and support!