You need to sign in to do that
Don't have an account?
S_Batman
Limiting Number of Accounts per User
I am trying to limit the number of Accounts per user that have the custom field "Protected" checked off. I created the following trigger and tested it out on sandbox but it doesn't seem to be working.
accs.addError('You are your limit of account');
Just replace the System.debug() with above like.
Let us know if this will help you
Thanks
Amit Chaudhary
All Answers
accs.addError('You are your limit of account');
Just replace the System.debug() with above like.
Let us know if this will help you
Thanks
Amit Chaudhary
IF(accs.protected__c == False) instead of True.
Then count existing accounts for that user where "Protected" is checked off and if it is >99 display error if limit is 100.
Secondly, Amit rightly mentioned you need to use addError function here to display error.
thanks,
Samar
Is there a way to limit number of Accounts per user without creating a custom field? How will the code differ then ?