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
1
vote
1answer
17 views

Help with Validation Rule on Contact

I want to Create a validation rule on contact object so that if the user profile = Services User, the Contact Name field is not editable. Solution : AND(ISCHANGED(FirstName), ISCHANGED(LastName)...
0
votes
1answer
15 views

How can I prevent users from updating the status to anything but closed?

I am trying to prevent a customer from updating the status of a case to anything other than closed with a validation rule. What I have works when I update the status, but also for closed. Here is ...
1
vote
1answer
31 views

What is the validation rule for a text field that shouldn't contain data if the correct picklist value has been selected first?

I created this Validation Rule that when a user selects Yes from the, Any_other_liens_filed_against_you__c picklist but tries to save the record without completing the text field, "...
0
votes
1answer
34 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
1answer
23 views

City Validation rule

I am trying to put a validation rule in place: If City is Mumbai it should not be allowed to change it to another, whereas if City is not equal to Mumbai it can be changed to anything but not Mumbai. ...
0
votes
1answer
34 views

REGEX in Validation Rule

I have a custom field on an object which should allow values based on the following JavaScript REGEX. /[^\sa-zA-Z0-9.,:?;%/()'!""-]/g Can anyone help me how to use this REGEX in validation rule ?
0
votes
1answer
28 views

Validation rule that allow only number along with a specific string

I want a validation rule that should allow only number (0-9) and a specific string ('N/A') which contains a special character also. NOT(REGEX(Code__c, "[0-9,;N/A]*")) The above validation rule is ...
0
votes
0answers
31 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
0answers
16 views

Validation rule error triggers page to switch from Lightning to Classic

I've created validation rules to dissallow users to change a 'status' field until certain fields are populated. This issue occurs when a user tries to change the 'status' without populating necessary ...
0
votes
0answers
18 views

Restricting picklist values on Opportunity, when field is a formula text

I have a situation not sure how to solve. Trying to make a pick list field with 4 choices for all users except Administrator and 2 specific users. There will be 15 other choices for Administrator ...
0
votes
0answers
14 views

Custom validation rule of lookup field is being called from Aura component of custom object

I have a custom Object which has look up relation with Account. I have made a custom lightning component on custom object as quick action in which user selects the lookup field for account and save a ...
1
vote
2answers
41 views

How do we handle existing bad data on restricted picklist value

I have a bunch of existing values for picklist and now we want to make the picklist as restricted picklist. Some of the records may contain values which are not in the restricted picklist. I ...
0
votes
1answer
24 views

Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 4

I keep getting Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 4 Can anyone advise on where its pulling the 4? IF ( $UserRole.Name = "x", IF( AND (Quantity >...
0
votes
1answer
23 views

Lock Record with Exception of enumerated fields

I have a case where we want Closed Opportunities to be read only for a certain profile, with the exception of two fields, Opportunity Owner and a custom field we have (then I also assume I would need ...
2
votes
3answers
75 views

Validation rule to allow number, decimal and percentage

I am trying to write a validation rule which will allow only numbers, decimal and % symbol. Below are the samples i am trying but it is not working. If I put 17.5% it is not working Any number upto ...
0
votes
1answer
29 views

Validation Rule (Multipicklist field)

Field 1 is Multi picklist field and Field 2 is a text field. Trying to create a validation rule if Field 1 is not blank and Field 2 is blank, an error message should appear. Similarly when Field 2 is ...
1
vote
1answer
33 views

Validation Rule Error when converting a lead

I have two picklist fields with dependencies in place. One is Lead Status and One is Status Subcategory. I have a VR so that forces the user to complete the Status Subcategory if the lead status is ...
0
votes
1answer
22 views

Validation Rule to fire only when updating field Manually

I am trying to create Validation that fire only when someone try to update record manually but it should not get fire if changes due to Process/Apex/Flow Any suggestion ? Validation Rule : AND(...
1
vote
1answer
36 views

Validation rule on lead conversion. preventing specific users ownership of records

I'm trying to prevent a specific user from owning Opportunity/account/contact records upon reassignment on lead conversion. Here is what i got so far and I cant seem to get it to work... Any kind of ...
-3
votes
1answer
28 views

Syntax Error - Missing ')'

I am user69787. I can't seem to register that account. Thank you @PartOfTheOhana. I am now getting syntax error. Missing ')' OR( AND( ISCHANGED(OwnerId), OR( $...
1
vote
0answers
24 views

Lightning modal - Scroll to top of page when there is a validation rule error

I am making a component that has a similar functionality like the standard lightning component. I am using modal mode and normal mode based on a value provider. I want when there is a validation error,...
0
votes
1answer
21 views

Verify input origin of a sObject field

I have a field that is filled by file import, so I need to check if this field was fill by hand or imported. Is there any way to implement a validation rule with a condition that verifies whether or ...
0
votes
1answer
37 views

validation rule for sum of percentage field should not be more than 100%

HI I am looking validation rule and am not sure whether can be done with validation rule. I have a task where I will mention an account executive and assign quota and revenue % for that account ...
1
vote
0answers
27 views

ISCHANGED always return TRUE on RichTextArea

I have a validation rule that should prevent changing of Rich Text Area field after creation. In order achieve this I created a validation rule that use ISCHANGED(RickTextArea__c) formula, but it ...
0
votes
1answer
19 views

Validation Rule- Field update for 2 profiles

I'm trying to have a validation rule to allow 2 profiles to update a date field. it throws an error each time saying the user cannot update the field. AND( NOT( ISBLANK( PRIORVALUE(...
2
votes
1answer
49 views

Regex - Syntax error

This is my regex (for international phone number), i have the message "Syntax Error" with this part of regex highlighted : s*[)]?[-\s.]?[(]?[0-9]{1,3}[)]?([-\s.]?[0-9]{3})([-\s.]?[0-9]{3,4})') ...
0
votes
0answers
22 views

Help in Permission Set in Validation Rule

I have this below scenario - I have a Custom Object - CustomObject__c , which has a picklist Status__c. Status__c field has values as New Approved Rejected Hold I have two permission set - ...
0
votes
2answers
26 views

Validation rule to prevent entering same data on

We have child object "Auto" on Account object.There is a text field Auto Number on Auto object. We need to prevent reps from entering same number for this field for different records for same account....
4
votes
1answer
52 views

REGEX Validation Rule for Phone Number [closed]

I am trying to create a validation rule for phone number and using the following regex Validation : NOT(REGEX( Phone, "^(?=.*?[1-9])[0-9()/\\-\\+\\s\\.\\ ]+$")) The above regex is working fine if ...
1
vote
1answer
72 views

Validation Rule on Conga Composer Button

I have a button as per below, that will generate a document for the client when clicked. However, I want to ensure this only fires when a field Job_Number__c has been filled out. And if the field is ...
1
vote
1answer
14 views

Assign leads per slot time

can validation do this ? Max 10 leads on Slot time per branch.. For example only 10 leads must be in 10:00am(Slot Time) per Iron Man(Machine).. Or apex/triggers will the job
0
votes
1answer
42 views

How to bypass out of box and custom validation rules when Close Opportunity Request is automated

Earlier we used to close the Opportunity manually but before closing it there are some validation rules and apex validation rules gets triggered. Now with the help of apex, I have automated ...
2
votes
1answer
93 views

Validation rule Scheduled Apex

I have a scheduled apex job which updates a field which is controlled by a validation rule as follows: AND( Not(ISNEW()), $Profile.Name != "System Administrator", ISCHANGED(...
0
votes
1answer
47 views

Incorporate Record type name on validation rule formula

I am trying to create a formula that restricts multiple checkboxes from being ticked. User should only be able to tick one checkbox per record. I've managed to create the formula that handles this ...
0
votes
1answer
16 views

Created Validation rule to ensure product has been added before a certain stage, but can't add products

Created Validation rule (below) to ensure product(s) has been added before a certain stage, but can't add products to an already created opportunity that is beyond that stage. When I go to add a ...
-2
votes
1answer
30 views

Validation Rule not working properly as per the Requirement

Need a small help, i am trying to create a validation rule on a lead object - the requirement is whenever the lead status is converted to "Closed - Not Converted" it should throw an error on ...
0
votes
1answer
35 views

Can we delete Validation Rule through apex code?

I have got a User Story to delete all the Inactive Validation rules in Salesforce. Instead of doing it manually I am finding another way(through Apex Code) to do it.
0
votes
1answer
42 views

Validation rule triggered even with wrong status

When the status is "Completed" or "Complete" no one should be able to edit a record. I wrote the following validation rule: AND(OR( AND( NOT(ISCHANGED(Status)), OR( ISPICKVAL(Status, 'Complete'), ...
0
votes
1answer
20 views

Prevent new activity being logged against inactive accounts

Our accounts have inactive checkbox. When this is checked users should not be able to create new tasks/events I tried validation rules like: (on both task and events) AND( ISNEW(), $Profile.Name <...
-2
votes
2answers
33 views

Validation rule for text field - It should accept only numeric value and accepts only 12 or 13 digits [closed]

Note : We can't change the field type to number because it is existing field.
0
votes
2answers
50 views

validation rule for text field to be changed

Validation rule for Text field - It should be not blank OR if any value already in text field then it should be changed. Based on two conditions: Picklist value should be Rejected RecordType....
0
votes
1answer
18 views

Validation rule that limits what products to add to opportunity by oppRecordId not showing error

I have a validation rule on the Opportunity Product object...it's the only one that i could reference the Opportunity object and the Product 2 object. AND(Opportunity.RecordType.Name = "Happy Fun ...
2
votes
2answers
42 views

How to prevent manually changes of Status field for Cases and Opportunities?

The Status field of Case and Opportunity objects cannot be read only for any profile. How could I prevent the manual changes only? I've tried with a validation rule that allows a free choice when ...
0
votes
1answer
24 views

New validation rule not working fully

i have created a new validation rule which should prevent saves to a dunning action record if the type is email and either email body OR email subject is null. Currently i have: AND( ISPICKVAL(...
0
votes
0answers
21 views

issue in Validation rule firing

I have a one validation rule which is checking if phone length is 10 and start not with 03 then thrown an error I have also written a code in before trigger which is updating 0 to +91 I have a issue ...
0
votes
1answer
118 views

How do I use standard object Validation Rules in a Lightning Component?

I'm still learning how to use Lightning Components and would appreciate help. I have several Validation Rules on a child object. There is an action on the parent object which uses a Lightning ...
0
votes
1answer
39 views

Error while adding validation rule on status field on close case page

I am writing a validation rule to add a error message on case close page, if user trying to change the case status to resolved for the already resolved cases then it should through an error stating ...
0
votes
1answer
48 views

Help needed with creating a New formula field

I am having an issue with a validation on a field in my Case object.I have the below requirement.Can somebody help? The Field should allow only a total 11 digits. These 11 digits can be divided into ...
1
vote
0answers
16 views

Can some explain below formula of excluding weekends counting

Can some explain below formula of excluding weekends counting, I want the explanation I'm not able to understand the below formula. The formula is : CASE(MOD( ActivityDate - DATE(1985,6,24),7), ...
1
vote
3answers
191 views

validation rule to prevent user changing ownership

I'm trying to create a validation rule to prevent 'portal' profile users to change ownership of lead record but they should be able to accept leads from 3 particular queues. OR( AND(ISCHANGED( ...