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
Marco Ivan MejiaMarco Ivan Mejia 

Restrict creation of cases

I have a validation rule that prevents a community user from creating a case if he has yet to qualify 2 or more previous cases (this is a way to measure the quality of the service). However, the validation rule marks the error until the user tries to save, and that is not the operation I want .... I would like that whenever a user has 2 or more cases without qualifying, it prevents the creation of cases , that is to say, that it does not have the possibility to fill any field until it responds the cases that it has pending to qualify.

P.S. sorry if my English is not very good, it is not my native language and I use an automatic translator to ask this question.

Thank you!

Prakash NawalePrakash Nawale
HI Marco,

Yes, you can achive this but not only with valiation rule.

First you need to create rollup i.e. total no of qualify cases on account/contact object and whnever case gets crated get rollup to account/contact object.
Use the rollup field value in case validation rule.

 
Marco Ivan MejiaMarco Ivan Mejia


Hi @Prakash, thanks for replying.

I already have a summary field. Currently a validation rule works ... My interest is that when clicking on the "New" button, an error message or some mechanism that prevents the creation of the case from that moment appears.

Prakash NawalePrakash Nawale
okay, Make account/Contact field required on case pagelayout for community user.
In validation rule traverse to account/contact and check total qualified cases if you conidtion not meets then throw error.
 
saurabh_kumar_Ssaurabh_kumar_S
Hi @Macro Ivan Mejia 
I think you should override new button on case object with a visualforce page , where by the help of controller you can check  if current user is community user and he has two or more previous  cases are stil not qualify than  instead of redirecting to create new case page , it will show an error page with suitable statement .
In this way community user will not have to fill any fields and click on save button if they comes in this criteria.


 
Ramakrishna Reddy GouniRamakrishna Reddy Gouni
  • who is decide case is valid or not?
  • make a flag on case, for an invalid case
  • write a trigger to validate user, if he/she has more than 3 invalid cases 
  • must and should use before insert for case objet trigger