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
abhi11abhi11 

Tired validation rule and its not working

I have objects(Topics and Teams) which are Master-detail to Case. Teams have a lookup(User) field. Scenario: When a Case status changed from escalation to closed and if there are certain users in the teams then Topic needs to have at least one record before closing the case
ANUTEJANUTEJ (Salesforce Developers) 
Hi Abhi,

Can you try using a trigger with before insert to check the condition?

Regards,
Anutej
Surya PSurya P
Hi Abhi,

If you want to go with admin without writing code,Try using this method.

First create a formula with number type in "Teams" object giving value as "1" if user is not blank and "0" if it is blank. For example:
" IF( ISBLANK( User__c ) , 0, 1) " 

Then create a roll-up summary in Case with roll-up type "Sum" and select the formula field which you have created in Teams.
Then write your validation in Case, I think this may work.

Please mark this answer as best if it helps you.

Regards,
Surya
abhi11abhi11
@Surya P: Not trying to check if the user is blank or not. Multiple users get added to Teams. Lets say we have certain users on the team then the Topic should not be empty
abhi11abhi11
Anutej 
Just started learning development I might have some difficulty to write a trigger.