Questions tagged [validation-rule]
Validation rules verify record data meets the standards you specify before the record can be saved.
1,150
questions
-1
votes
1
answer
34
views
Validation Rule on File
I was asked to ensure that files cannot be deleted after 24 hours. I tried to create a validation rule, but the closest object I found to 'File' in the Object Manager is the 'ContentVersion' object. ...
0
votes
1
answer
45
views
What is the better way to know if the value was already used in the record previously?
I need to have a validation wherein a certain picklist value (e.g: in progress) was already selected before in the record. So basically, the "in progress' status should only be selected once in ...
-1
votes
1
answer
35
views
Required Lookup field | Screen flow
I have a field in a screen flow. This field is used by different departments, but one in particular is asking me to make the field mandatory when the user navigates through the screen flow. The issue ...
0
votes
1
answer
46
views
Salesforce API Error: CANNOT_MODIFY_MANAGED_OBJECT for ValidationRule
I'm encountering an issue modifying a Salesforce Validation Rule via the API. My attempt to update the rule with the ID '03dDn000001evPOIAY' results in the error message:
"Cannot modify managed ...
-2
votes
2
answers
32
views
Validation Rule on Call Object
I am trying to create new Validation rule in "Call" object with field Attachment_placed_on_the_call__c as checkbox for the following requirement:
If Interaction Type is "Reactive" ...
0
votes
1
answer
26
views
How to verify a custom metadata type relationship field's datatype
I have a CMDT SObject called MyCmdt__mdt
It has two fields
Field Name
Field Type
SObjectType__c
Metadata Relationship (Entity Definition)
SObjectField__c
Metadata Relationship (Field Definition)
I ...
0
votes
1
answer
29
views
Having difficulties hiding a picklist value with a Custom permission and a Validation rule
I need to be able to hide one picklist value from a field on a Custom object from a set of users. I've created a Custom permission (View All Statuses), and a Permission set to assign to users who ...
-2
votes
2
answers
77
views
Salesforce Validation Rule - make a picklist field required when checkbox is true [closed]
This seems like it should be simple, but I'm struggling.
I have two fields:
ApprovedSupplier__c is a checkbox, when it's checked and it's value is true, I need the picklist field SupplierTier__c to ...
0
votes
0
answers
47
views
How to prevent a 2GP Package from being blocked by a customer's validation rules?
When a user installs my AppExchange package, I am using the InstallHandler to run a Batch job to populate a new custom field on the Opportunity object for every single opportunity, as recommended here....
1
vote
1
answer
34
views
Can't send an automatic email when validation rule is triggered
When I get an email from specific email address with specific subject, I want to:
Block this email from creating a case
send an automatic email to this email address that their case wasn't created.
...
0
votes
1
answer
48
views
Validation rule that excludes a picklist doesn't work
I have a validation rule that prevents the case from closing if it does not have an associated account, however, I need to ignore this rule if the picklist value is "E-mails que não são casos&...
0
votes
2
answers
52
views
How to exclude a related object type from validation rule
I have an Object called 'Program' which is creating/inserting a Task record.
On the Task I have a validation rule for a specific profile which is blocking the creation of Program indirectly through a ...
0
votes
1
answer
54
views
Validation Rule firing for Unknown Reason
Here is my rule - it fires when I try to move to > 75% probability on an Opportunity NOT owned by me.
It does NOT fire in my sandbox.
AND(
Owner.Id = LastModifiedBy.Id ,
ISCHANGED(Probability),
...
0
votes
0
answers
24
views
Oracle exception updating Account record
On the Account SObject I have defined a validationRule which checks that the billing country of a record must be the same as parent account's billing country if it is defined
AND(
NOT(ISBLANK(...
1
vote
1
answer
40
views
What's this Label in Validation Rule?
I was looking at a Validation Rule and it has below text. I would like to know where this $Label is located in Object Manager?
CONTAINS($Label.List_of_users_and_profiles, $User.Id),
CONTAINS($Label....
0
votes
1
answer
70
views
Validation to require a field updated
I need a couple number fields updated when a checkbox is checked, but if there's already info in the number fields I want it updated. Here's what I have:
AND(
Field_Follow_CAxT__c = True,
OR(
ISBLANK(...
1
vote
0
answers
70
views
Avoid using merge fields in validation formulas
So I've just come across this as part of Salesforce best practices for validation rules.
Avoid using the IsClosed or IsWon opportunity merge fields in validation formulas. Instead, use the ISPICKVAL ...
-1
votes
2
answers
56
views
Need help in forming validation rule
I have to two fields Payment status and manager status
So have to create a validation rule where if Manager status is Blank and payment status is closed then block payment status update.
My formula is
...
0
votes
1
answer
37
views
Validation Rule Not Functioning
Below is the validation rule that should trigger when: To close this move, the Art Handler Must enter Color Temp and Light Intensity for Fine Art items moving to NG2A or NG3A.
AND(
$UserRole.Id = '...
0
votes
0
answers
78
views
Validation Rule IsChanged
I have this validation formula, which is not firing when I provide a Contract_End_Date__c prior to today's date. Otherwise for any future date it is working as expected.
AND(
ISPICKVAL(...
0
votes
0
answers
113
views
Custom validation rule - for unique value
I'm using Custom Metadata Types and writing validation rule to find if this combination has uniqueness if it's (meaning its a duplicates) then throw an error
here is what I was able to do but I'm ...
-1
votes
1
answer
77
views
Write a Validation Rule based on criteria
Write a Validation Rule on Account object of Salesforce which creates an account only when Rating is "Hot". Also, After creating the account, when we need to update it, Rating can only be ...
1
vote
0
answers
55
views
Help: validation rule (Product/Product Family)
I need to build a validation rule with the following requirements in 'Product' object:
Family Product = 'PestControl' (picklist/native)
TypeProduct__c = 'Contract' OR 'Active' (picklist/custom)
IF ...
0
votes
1
answer
69
views
How to bypass a validation rule on event creation?
I want to bypass this validation rule on new event creation and this validation is on contact object
NOT(
OR(
LEN(Linkeldin__c) = 0,
REGEX(Linkeldin__c, "^https:\\/\\/[a-z]{2,...
0
votes
1
answer
88
views
Validation Rule on Parent opportunity field by checking child opportunity field
We have Parent Opportunity and Child Opportunity Record Types with the same Delete check box field. I am trying to write a validation on the Parent Opportunity - Delete check box field. Unless a user ...
-1
votes
2
answers
116
views
REGEX Validation Rule error on blank field
I am trying to create a validation rule for a text field to only allow letters and a few special characters to be saved in the field. The special characters are " - ", " . "," ...
0
votes
0
answers
108
views
Approval Process Update conflicting with validation rule
I have a flow that automatically fires an approval process that needs unanimous approvals from three different managers. When the Opportunity enters stage 5, this before-save record triggered flow ...
0
votes
1
answer
82
views
Nested AND/OR Statement in a Validation Rule on the Case Object
I've tried following other resources, but decided to share this one to see if anyone could help me get the syntax correct:
I need to display an Error message on the Case Record when someone tries to ...
0
votes
2
answers
234
views
What is the best way to prevent a field from being editable at a certain value?
I have a checkbox that I would like to not be un-checked once it's been checked. I've accomplished this by putting in a Validation Rule.
AND(ISCHANGED(Field__c),PriorValue(Field__c) = True)
But is ...
0
votes
1
answer
121
views
Validation Rule on Pre-Chat Intake form
I'm seeking a way to implement validation for the "Phone" field within the standard Pre-Chat form. While I've successfully added a 10-digit validation rule to the "Phone" field on ...
-1
votes
2
answers
300
views
Contact Role Required on Opportunity Upon Creation
I want to have contact roles required when an opportunity is created or even marked as stage 1. However, I only want to use this on my renewal opportunity record type and not the others. How would I ...
0
votes
2
answers
115
views
How do you block a user from updating a particular field while allowing a flow to do so?
I need to allow a flow to update a record status to a particular stage, while users are prevented from doing so.
My problem is that if I set a validation rule to prevent users to update a record ...
0
votes
1
answer
61
views
Is there any disadvantage or limitations when using Custom Permssion in Validation Rule?
I just need to confirm your experienced, if there is something I need to be aware of in using Custom Permission?
We are hesitant to used the custom permission assigned to permission set to create ...
-1
votes
2
answers
45
views
validation rule to allow an upgrade of priority, but not downgrade [closed]
I have a need to have users be able to change a Priority but only if its being upgraded. Our priorities are
P1
P2
P3
P4
I don't want certain users to be able to move a case from a P1 down to a P4, but ...
1
vote
1
answer
76
views
Validation rule help - After Stage passes
I want to enforce my users to fill out two fields but instead of making those fields compolasory at the start I want to create a validation rule so when the Opportunity passes a stage they have to ...
0
votes
0
answers
178
views
How to insert REGEX line breaks in Validation Rule
The Validation Rule listed below is supposed to fire if the below criteria is not met:
For Sales Orders, enter between 6-8 digits
OR
For Delivery IDs, enter 10 digits.
Users may enter multiple values ...
0
votes
1
answer
197
views
Prevent the merge of Contacts from different accounts
I have created a validation rule to prevent the merge of Contacts from different Accounts, but I get this error:
AND(
NOT(ISBLANK(PRIORVALUE(AccountId))),
NOT(ISBLANK(AccountId)),
PRIORVALUE(AccountId)...
-1
votes
2
answers
221
views
Salesforce formula for multiple picklist values
I am trying to write a formula where if Field- 'Status' contains picklist value as 'New','In-progress' or 'Escalated' then I want to make Field - Urgency to 'False'.
Can anyone please help me I tried ...
0
votes
2
answers
789
views
Validation Rule error message always showing on top, not under the field
I have a validation rule and it should display the error message
under a checkbox field 'Consent received to add as a Contact ?' but it is always displaying the error on the header of the page.
I have ...
-3
votes
1
answer
263
views
Create a validation that will not fire unless the amount is greater than 0
I am trying to create a validation rule that will fire when the Amount_1 is greater than or less than Amount_2 but not when Amount_1 = 0
Amount_1 <> Amount_2
-1
votes
1
answer
44
views
Validation Rule Conflicting with Process builder
I have this validation rule which locks the field of opportunity when its closedwon/lost. But it is not working as it is conflicting with a flows(which updates closewon/lost dates as today() ) saying ...
3
votes
2
answers
380
views
How to use Custom Label in REGEX function in Validation Rule
I am able to use the regex formula string directly in the validation rule and its working fine when I tested it.
AND(
CONTAINS(RecordType.Name, 'International_Lead'),
!REGEX(Phone, '^(\\+)\\d{...
1
vote
1
answer
110
views
Can you automatically retry a trigger if record validation fails without user intervention?
We have a custom field with the Unique Id attribute. This field represents a randomly generated string that is used as a publicly facing identifier.
This public id field is randomly generated and ...
-1
votes
2
answers
98
views
Validation rule for Multi picklist
I have a requirement where if a value "Others" from a Multi picklist is selected, "please explain others" text box should be used, if any other value from Multi picklist is ...
0
votes
0
answers
93
views
Validation rule to prevent editing a record [duplicate]
I'm new to validation rules and I'm trying to write one for a custom object that looks at a field called Status and once the picklist value is changed to "Complete", then no one can edit any ...
-1
votes
1
answer
212
views
Validation Rule for locking specific fields
I am looking to create a validation rule that if the checkbox "verified" ( Verified__c ) is checked then it locks these three fields, Legal_Entity_Name__c , ...
-2
votes
1
answer
256
views
I need to exclude one profile from a validation rule
Lead Source a mandatory field and the validation rule on conversion means it has to be completed. this is true for all our users with the exception of 1 user profile. How can I exclude them from this ...
0
votes
0
answers
49
views
Validation rule . sales lead(Custom Object) locked by another user only "sales Executive" tagging lookup(User) field should be editable all user
We can't save this record because the “Share Sales Lead Record” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to update records: ...
0
votes
2
answers
88
views
dependent text field validation issue
I'm writing a validation rule for dependent text field. If user has selected "Other" option then must fill text field. ---> done like below
But if any value choosen except "Other&...
0
votes
0
answers
95
views
Why insert is rolled back when validation triggered in bulk update
I have list of 2 records i try to update in bulk from object foo__c, this should trigger an insert of 2 records from the object zoo__c.
One of the updated foo records hits a validation rule (as ...