Skip to main content

#Validation Rules0 discussing

5 answers
  1. Nov 22, 2025, 9:58 PM

     It sounds like the validation rule is saved but not being recognized during the check. Make sure the rule is active, the error condition formula is correct, and that the challenge test data actually triggers the rule. Sometimes Trailhead requires very specific field names or conditions to match their criteria. If everything looks right, try refreshing the playground or creating a new one, as playground glitches can prevent the checks from running properly. This usually resolves the issue. 

0/9000
1 comment
  1. Jul 21, 2025, 7:07 PM

    Hi @abirami panneerselvam, Thank you for reaching out to the Trailblazer Community. We assume this issue needs further review and we may need access to your playground. We will reach out to you via email to investigate further.

     

    ++CreateTrailheadCase

     

    You can ignore the command above, it is a tool used by our Agents to tell the system to create your case.

     

    Thank you!

0/9000

Hello,  

 

I have a validation rule written as such:  

 

AND( 

OR( 

ISPICKVAL(StageName, "Budget"), 

ISPICKVAL(StageName, "Sales Quote"), 

ISPICKVAL(StageName, "Negotiation / Review") 

), 

 

ISCHANGED( CloseDate ), 

$

Profile.Name

 <> "System Administrator", 

$User.Username <> "

yaritza.romo@hollman.com

 

 

It is currently saying (with additional parameters) opportunity close date cannot be changed at all - how can i revise this to say that a close date CAN be brought in from another month, but NOT pushed out from this month? 

 

(we are trying to keep our pipeline honest - need rules to help, not allowing sales users to push out opps but definitely bring in opps if they can)  

 

PUSH OUT = Edit close date to be in a future month 

BRING IN = Edit close date to be in current month 

 

Thanks! 

 

@Admin Group, Dallas, US #Validation Rules

 

@Who owes me a beer?!?

10 comments
0/9000

I have created one Custom validation rule on Lead status field that will check if the Lead.IsConverted is true and the previous value of Status is not "Contacted" then It will display error. 

I want this because on the contacted status first I am killing all the time-based workflows and then I want to convert the lead so that the "Unable to convert lead that is in use by workflow" will not occur. But this won't happen, the "Unable to convert lead that is in use by workflow" will display if the time-based workflows are there and I am trying to change status from "Open" to "Converted".

 

Here I want to display my custom validation error before "Unable to convert lead that is in use by workflow" error.Is there any way we can do this? I also tried with Before Saved record trigger flow but that also not worked.

Is there any other work around we can achieve this?

0/9000

Any ideas?

 

Validation in salesforce passes syntax but doesn't work

 

AND(ISNEW(), CONTAINS( Subject , "Employee Huddle") || CONTAINS( Subject ,"Inside Track") || CONTAINS( Subject ,"IT Maintenance") || CONTAINS( Subject ,"Carrier Updates & Commercial Corner"), CONTAINS( Subject ,"IT Important") || CONTAINS( Subject ,"EPIC Maintenance") || CONTAINS( Subject ,"EPIC Downtime") || CONTAINS( Subject ,"IT Alert") && ISPICKVAL ( Type, "Insurance") && ISPICKVAL ( Origin, "Email")).

 

#Validation Rules

7 comments
0/9000

I need to enforce the picklist when creating an event so that manual text input is not possible. I think I need to use the ISPICKVAL function but am not sure what to put as the "picklist_field, text_literal" part.

 

#Validation Rules

3 answers
  1. Oct 23, 2024, 8:32 PM

    @Kate Williams are you just trying to make the field itself required?  or validate specific values selected?

     

    If you just want to make the Picklist required you can use an ISBLANK and TEXT Function like this

    ISBLANK(TEXT( Field_Name ))
0/9000
3 answers
  1. Oct 23, 2024, 8:30 PM

    Are the fields DateTime or just Time?  

     

    If they are just Time field could you ever have a scenario where the Departure could be 10:00 PM and the Arrival 6:00 AM the next day?  Or are they always within the same day?

0/9000

On a date/time field, I want to put in a validation rule for user to only put top of the hour. This means they can't put 1:15pm, 1:30PM, 1:45pm. They can only do 2pm,3pm,4pm, etc. 

 

#Data Management  #Validation Rules  #Salesforce Developer

4 answers
  1. Oct 16, 2024, 3:07 PM

    Please try below formula, worked for me.

    MOD( VALUE( MID( TEXT( DateTime_Field ), 15, 2 ) ), 60 ) <> 0

0/9000

🔍 Seeking Advice from Salesforce Wizards 🔍

 

Hey, Salesforce experts!

I'm currently tackling a tricky logic puzzle in Salesforce, and I could use some guidance.

 

Here's the scenario: I have a requirement to ensure that two lookup fields on a record maintain a one-to-one mapping. To accomplish this, I've implemented a before insert/update trigger to enforce the mapping. Additionally, I've set up a validation rule to prevent changes to the lookup fields once they are populated.

 

Now, according to Salesforce's order of execution, validation rules should run before triggers. However, I'm encountering a situation where the trigger error is firing first, even though I expect the validation rule to take precedence, when i am trying a update a lookup field after it's already populated.

 

Feel free to drop your thoughts in the comments below or reach out to me directly. Your expertise could be the missing piece of the puzzle!

 

#Salesforce Developer  #Automation  #Apex  #Triggers  #Validation Rule  #Validation Rules

1 comment
  1. May 14, 2024, 10:04 PM

    Hi @Adarsh Agrawal,

     

    Please refer to the documentation below.

     

    Triggers and Order of Execution | Apex Developer Guide | Salesforce Developers

     

    1. Salesforce performs different validation checks depending on the type of request.
      • For requests from a standard UI edit page, Salesforce runs these system validation checks on the record:
        • Compliance with layout-specific rules
        • Required values at the layout level and field-definition level
        • Valid field formats
        • Maximum field length
      • Additionally, if the request is from a user object on a standard UI edit page, Salesforce runs custom validation rules.
      • For requests from multiline item creation such as quote line items and opportunity line items, Salesforce runs custom validation rules.
      • For requests from other sources such as an Apex application or a SOAP API call, Salesforce validates only the foreign keys and restricted picklists. Before executing a trigger, Salesforce verifies that any custom foreign keys don’t refer to the object itself.
    2. Executes record-triggered flows that are configured to run before the record is saved.
    3. Executes all before triggers.
    4. Runs most system validation steps again, such as verifying that all required fields have a non-null value and runs any custom validation rules.

    Please check the fourth point.

     

    Thanks!

0/9000

Hi ,im studying about validation rules and came up with a requirement to create validation rule on the "Account" object that prevents users from deleting an account if it has related "Opportunity" records

 

how can we achieve this ..

 

please help...in learning stage to explore Salesforce..

 

thanks

 

#Validation Rules

8 answers
  1. Steven Trumble (Strum Consulting) Forum Ambassador
    Feb 26, 2024, 12:45 PM
    First you'll need a roll-up summary from opportunity to account. You can simply count the number of opportunities. Then your validation rule just needs to check if this roll-up summary field has a value greater than zero.
0/9000