Hi Jonathan,
If you simply want to be able to evaluate and enforce this manually, the quickest way to obtain a count of how many customers and leads are assigned to a particular sales rep is through an SQL override.
Here is an example of a field I added to the QuickBooks_SalesRepList that uses an SQL override to count the number of customers assigned to each sales rep.
You can add any field, with the exception of RecordID fields, to the grid and override them with an SQL statement by selecting the advanced link.
You can do the same with an additional field for counting the number of leads instead.
If however, you want to be able to enforce these rules through actions on your screens, you will need to count and store these values in a field on a table. This is a process that will still require some manual input.
You will need to create a button that loops through each of your sales reps and counts the number of customers that are assigned to them, storing the result in a custom field on the table. This is not an efficient process and this action will likely take at least a couple of minutes to complete processing.
Once you have calculated this value, the actions on your screens can check agains it to evaluate if a sales rep can take on any additional customers / leads. Keep in mind that this value is only updated when you select the button you created.
The scope of this is quite large and the reliability isn’t great. Overall, my recommendation goes to the more simple SQL overrides and enforcing these rules manually.
I hope this helps.
-Audisho