Skip to main content

Questions tagged [validation-rule]

Validation rules verify record data meets the standards you specify before the record can be saved.

Filter by
Sorted by
Tagged with
0 votes
3 answers
4k views

Use Picklists in Formulas - Admin Advanced Trailhead Module

Can someone help me with this error? There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on ...
0 votes
1 answer
42 views

Validation rule to restrict picklist but still allow others to edit the record

I have a validation rule that restricts a picklist value so that only two users can select it. This is working well but the problem we're facing is that now no one, except those two users, can edit ...
1 vote
4 answers
57k views

Validation Rule for Phone Number that should only contain numbers and +

I'm trying to create a validation rule for Phone Numbers. Say, I have three Phone Number fields that should be checked if the values meet the following requirements: phone numbers should be 10-12 ...
2 votes
1 answer
223 views

Validation Rule on Case checking user's profile

I need to change picklist default value in the status of an external insurance case to "under review" if the users creating the record are Angelita, Caio or Ivan (Profile: External Insurance)...
-1 votes
1 answer
538 views

How do I write a validation rule for a Date/Time field that only allows choosing M-F and 8am-5PM

I have tried using the formula below: NOT( AND( WEEKDAY(DATEVALUE(Date_Time_Test__c)) >= 2, WEEKDAY(DATEVALUE(Date_Time_Test__c)) <= 6, HOUR(TIMEVALUE(Date_Time_Test__c)) >= 6, ...
0 votes
2 answers
365 views

Regex for Aadhar card is throwing an error

used this for validating Aadhar card NOT(REGEX(Aadhar_Number__c , "[0-9]{12}")) and I'm getting this error Incorrect argument type for function 'REGEX()'.
0 votes
0 answers
66 views

Problems with validation rules on Users

Been trying to set a validation rule on User Object where a field (Calendar_URL__c) becomes required for 2 specific profiles. The validation rule doesn't get triggered, no error whatsoever. here is ...
0 votes
2 answers
4k views

Validation Rule for Currency field with Max 2 decimal places

I am trying to create a validation rule for currency field which will take the maximum 2 decimal places only if you put the third decimal value it will should give you an error. My currency field is ...
0 votes
1 answer
577 views

Formula to restrict text field inputs?

I need to validate input on a screen flow's text field so that only "EB, EO, GA" are acceptable inputs from the user (Normally I'd just use a picklist but the client wants to leverage an ...
0 votes
0 answers
200 views

Validation rule preventing going back in Oppty stages while allowing user to close deals

I am trying to create a validation rule for Oppty object that: Prevents users from going back in Oppty stages unless user has certain types of profile Still allows users to close lost or won deals ...
1 vote
2 answers
153 views

Validation rule field mandatory only for unique profile

I need a specific case (here: Queue) owner to fill a field when the case is reassigned back to another owner. In other words: We get a case via email. We fill out the necessary fields and then ...
0 votes
1 answer
73 views

Validation rule to prevent users from closing cases before 9am

I want a validation rule that should prevent users from changing the status of a case to close before 9am. I wrote the following rule but it is giving me missing ')' syntax error: AND( ISPICKVAL(...
-2 votes
1 answer
98 views

Prevents the deletion of contracts that are in active status

I want to give a validation on contract that when contract status is on active nobody can't delete the contract. But I can't do this. If anyone have solution give me the solution it helps me a lot.
0 votes
1 answer
198 views

Flows: prevent rerun of custom validation rules

Salesforce are no longer allowing workflow rules or field updates to be created, and are informing developers to use flows. I have come across one significant difference which is causing us issues. ...
0 votes
1 answer
63 views

Null Pointer Exception when referencing a known valid field

I am writing custom before insert validation rules into a Case trigger to check fields on Account when a related Case is created. When running my test classes they all pass which leads me to believe I ...
-2 votes
1 answer
157 views

Moving Validation rule to Trigger

I want to move this validation rule to trigger the Validation rule is AND( LR_Disease_Condition__c = $Label.Label_for_Disease_Condition, NOT(CONTAINS( $User.LHJ__c , ...
-2 votes
1 answer
133 views

Error: Syntax Error. Missing '=' in validation rule formula

I have this formula for my validation rule that will check for an existing record and then prevent the user from submitting a request if a record has been found. However, I'm having a syntax error ...
0 votes
1 answer
37 views

Validation formula suggestion

I am working on a validation formula where I need to check if the Approval Officer's value is 005f4y78378u8373. If it is, I will then check if the product falls into any of the following categories: ...
0 votes
1 answer
240 views

Validation rule - Salesforce CPQ Contracted checkbox

I want to write a validation rule on the Opportunity record - Condition:- User can only check the contracted checkbox if the opportunity stage is closed won and primary quote (lookup field) - status ...
1 vote
1 answer
1k views

How do I prevent going backwards in an opportunity once a specific step is reached?

I need to prevent users to change opportunity status back to an earlier stage once a specific stage has been reached. StageName values in order are: New Preselection Instruct Closed (Won/Lost) Once ...
0 votes
0 answers
364 views

How to bypass FIELD_CUSTOM_VALIDATION_EXCEPTION validation rule in Lightning Web Component

I am working on editing a record that would prevent a user from making changes in the page layout, they should use a button to make changes on a specific field. I created a new Validation Rule that ...
0 votes
1 answer
187 views

Help! Error: Incorrect number of parameters for function 'ISPICKVAL()'. Expected 2, received 1

I trying to create a validation rule, but I'm getting an error Error: Incorrect number of parameters for function 'ISPICKVAL()'. Expected 2, received 1 my formula is below. I don't want anyone with ...
0 votes
1 answer
42 views

account has status picklist values ->In Progress , Approved. It should only be approved when all of its related contact status becomes Approved

AND( ISPICKVAL(Status__c, "Approved"), NOT(ISBLANK(Contact)), NOT(INCLUDES(Contact.Status__c, "In Progress")) ) I'm getting error Error: Field Contact does not exist. ...
3 votes
2 answers
200 views

field should start with 304050 in salesforce

I have a custom filed with number datatype and I have a requirement the the field should always start with 304050 and I have to write a condition that it must always contain 16 digits. Is this posible?...
0 votes
1 answer
31 views

Validation Rules not covering Status change?

I have a requirement when record type is "Service_Cases" or "Service_Case_Read_Only" and 'Type' equals "Red Cross Store Support" and 'Status' equals "Closed - ...
0 votes
0 answers
1k views

Restrict user from choosing past time and date in date/time field in

I have a date/time field. As soon as user enters data, I want user to choose the time from future. How can i do that? In this pic I am able to select today, but time is 12:50. User should enter the ...
-2 votes
1 answer
78 views

Validation Rule formula for closed case

I'm trying to create a validation rule that when a certain case record type is closed if any of the fields listed are blank (they are checkboxes) the rule is fired. The below is not working: AND( ...
-1 votes
1 answer
128 views

My Loan amount Field cannot be edited

I have one task in that if my Loan_Status__c = Fundraising', Loan_Status__c = 'Fully Funded' then my Loan_amount_in_rs__c cannot be Edited only Admin can Edited by using Validation rule how I can ...
0 votes
0 answers
38 views

REGEX validation ignored unless separate REGEX validation fires

I am working to validate the format of a string to 4 letters-3 zeroes-4 letters. On it's own, this REGEX() works fine: OR( /* check the leftmost 4 for any digit */ REGEX(LEFT(String__c,1),"[0-9]{...
0 votes
1 answer
51 views

validate only a record that is not linked to another of the same type

I have a situation: In the order object I have two types of records: Sales order and Bonus order. In the layout of the bonus order there is the Origin order lookup field, I can only link a sales order ...
0 votes
1 answer
3k views

Validation Rule - ISBLANK() not working as expected

On the Lead object, I am trying to validate that my custom "Zip_Code__c" field and the standard "Email" field contain a value in this validation rule, but despite the validation rule being active, it'...
1 vote
2 answers
14k views

Checking for multiple values with CONTAINS

I'm trying to condense this validation rule formula: OR( CONTAINS( Email , "[email protected]"),CONTAINS( Email , "[email protected]") I want to use || logic but I'm receiving this error: Do I ...
2 votes
1 answer
130 views

Validation Rule not running the whole formula

A field(Example__c, Text 255 char) can have a value of alphanumeric(numbers and/or letters) type and character length should ONLY be either: 3 character value 7 character value 12 character value I ...
1 vote
2 answers
4k views

REGEX Pattern for "PO BOX"

I have a requirement to create a validation rule on custom object Address_vod__c. There is a picklist field in the object,'Type'. If 'Type' value is not 'mailing' then restrict to create or edit ...
0 votes
1 answer
62 views

Validation rule for 100 fields and editable only once by everyone but admin. Formula too long error

I have an object which has around 105 fields, but for the validation rule I need to use 100 fields. I need the fields to be editable if not null by all the profiles. However, the admin can edit any ...
0 votes
1 answer
72 views

Validation Rule Syntax error missing - Formula

I have created the below validation rule but when saving it shows Error: Syntax error. Found ')' Can someone help me identify what I am missing OR( AND( $User.Full_Name__c <> "Case Guest ...
0 votes
1 answer
56 views

3 out of 4 picklistvalues should make a field mandatory // validation rule

Hello dear developers, I have a really simple task (on paper) but just can´t get my head around (I´m no developer and don´t have the mindset to think in even if-then...) I have a dedicated opportunity ...
-1 votes
1 answer
283 views

Restrict all users to Change the Lookup Field

I am trying write a validation rule.I have record with lookup field which is blank and wanted to restrict all users on changing the field and this field should always be empty. AND( OR(ISCHANGED( ...
-1 votes
1 answer
380 views

How to make a number field dependant from a checkbox?

In sales orders I have 2 custom fields Qnty and Free Qnty and a checkbox Free Qnty Only. For orders, that have a number in Quantity it's possible to enter Free Quantity and the checkbox is set to ...
-1 votes
1 answer
118 views

Validation rule to disqualify leads before conversion (based on certain criteria)

Is it possible to implement a data validation rule to disqualify leads which annual revenue is less than £50,000K? How to apply this limitation at the time of conversion into a contact/account/...
-2 votes
2 answers
52 views

Priorvalue is not Exported then not allowed to change status to delivered

The below code is mentioned in formula editor and this is showing The formula expression is invalid: Incorrect number of parameters for function 'PRIORVALUE()'. Expected 1, received 2 PRIORVALUE(([...
-1 votes
1 answer
1k views

Validation rule allowing update of Close Won Opps & change Owner

Im fairly new to Validation rules. I am trying to create a validation rule for Opportunities which will only allow certain users, including Admin to change the status of a Closed Won Opp & to ...
-1 votes
1 answer
660 views

Require one of two checkboxes = True, based on Record Type

Require one of two checkboxes = True, based on Record Type We have two checkboxes "Serviced" or "Not Serviced", in which one will be require to be 'true' in order to save AND Only ...
-1 votes
1 answer
908 views

Validation Rule to Restrict date within current fiscal year?

I need help creating validation rule to restrict date between the Current Fiscal year of the company. Say, the user should be able to only select dates between Oct 1 to September 30 of the following ...
0 votes
1 answer
425 views

How to stop spamming leads from web to form?

We are trying to restrict the spam leads in salesforce coming from web-to-form. we have a name field that can bring the spam leads . for example that name holds ---- 5xg7t52899 . How to restrict the ...
1 vote
3 answers
680 views

Restrict of updating opportunity owner

I want to restrict updating the opportunity owner. I'm not able to use the validation rule because ISCHANGED( Owner.Id ) is not working. It's giving the following error, Error: The ISCHANGED function ...
0 votes
1 answer
652 views

Validation Rule to prevent 'Closed Won' Opportunities from being edited once a checkbox is selected by AR Team. Or should I change workflow?

AND( $Profile.Name <> 'System Administrator',NOT(ISCHANGED(Opportunity_Closed__c)),OR(Opportunity_Closed__c = true)) Got no errors with this but it seems to just autocheck the Opportunity ...
-2 votes
1 answer
222 views

Check Checkbox at Certain Stage

I need to ensure that when the stage is changing from Stage 1 to Stage 2, the checkbox is checked. Stage 1 = "1 - Qualify" Stage 2 = "2 - Consideration" Name of checkbox: ...
0 votes
1 answer
28 views

Validation Formula Help

Formula newbie question: We currently have a validation rule when a record on a custom object is created, there are a list of fields that must be popluated. See below for the current formula: (TEXT( ...
0 votes
1 answer
681 views

Validation rule where one out of the two fields must be populated to save

I would like some validation rule formula help please: When a standard end user profile tries to save an opportunity (standard opportunity record type), either the "APR" field OR the "...

1 2 3
4
5
24