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
John Manager Training DepJohn Manager Training Dep 

Create case and prevent case from being created?

Hi Team,

I have below requirement,

1) The Case can be created using email-to-case or manually.
2) There is a related object Resume.(It has ContactID field from Contact object using lookup relationship)
3) Both Case and Resume object has CaseStatus & Training fields. Also, Resume object has CasNumber field.
CaseNumber is a lookup field and CaseStatus is a derived field based on Case object CaseStatus.
4) Resume object has Trainingcourse field which mentions which course a Contact is assigned to. Each ContactID may have multiple entries in the resume object.
5) When a new Case is created and Training field is assigned to the Case, the combination of ContactId and Training should be checked if it exists in Resume object.
If combination exist and CaseNumber is present in Resume object, then Case should NOT be created. An error message should be thrown on the screen.
If combination exist and Casenumber is NOT present in Resume object, then Case should be created and CaseNumber should be entered in Resume object.

If the Combination of ContactId and Training does not exist in Resume table, Case should get created. ==> I know this doesn't make sense but thats requirement.
6) When an existing Case objects Training field is modified, the combination of ContactId and new Training should be checked if exists in Resume object.
If combination exist and CaseNumber is present in Resume object, then Case should NOT be created. An error message should be thrown on the screen.
If combination exist and Casenumber is NOT present in Resume object, then Case should be created and CaseNumber should be entered in Resume object.

If the Combination of ContactId and Training does not exist in Resume table, Case should get created. ==> I know this doesn't make sense but thats requirement.

I am planning to use Process Builder and Flow Builder Spring 19' combination  to check the condition, update the Case details in the Resume object.
I am not sure how can I prevent creation of Case if the combination of ContactId and Trainingcourse fields are already present in the Resume object?

Many Thanks in advance for all your help and support!
Kadhar Basha JKadhar Basha J
can you please provide clarification regarding the TrainingCourse field like data type and purpose
John Manager Training DepJohn Manager Training Dep
Thanks for response!

Each individual in the Resume must have a TrainingCourse assigned. Completion of TrainingCourse is mandatory for individuals in this object.

TrainingCourse is a global picklist field. Same global picklist is used in the TrainingCourse field in the Case object as well.


Any further constructive replies much appreciated!