Questions tagged [validation-rule]
Validation rules verify record data meets the standards you specify before the record can be saved.
1,156 questions
0
votes
1
answer
477
views
Validation rule to run on a particular role but exclude 1 username under that same role
Trying to create a validation rule to stop a particular Roles (example Role A, Role B and Role C) from changing info on a closed opportunity.
I have 1 user which I want to bypass this validation rule ...
0
votes
2
answers
678
views
Validation Rule referencing Case Function Formula Field
I am trying to create a validation rule on a custom object that prevents a specific status picklist value from being selected if a number field on the custom object is greater than a formula field on ...
0
votes
0
answers
554
views
Validation rule is still firing even when requirements are met
Hello Salesforce Experts,
I am hitting a wall on this validation rule I'm working on and hoping to get some help. My scenario is the validation rule should be checking for 3 criteria:
Stage is being ...
2
votes
1
answer
1k
views
Validation rule to restrict who can be owner of a case
Building out email to case for our customer service team, we only have sales cloud. I want to restrict who can assign and be assigned a case from the queue, same group of users would need to be able ...
4
votes
2
answers
1k
views
How to avoid duplicate look up combination in many to many relationship?
I am trying to learn many to many relationships for salesforce objects, I was able to implement it using a junction object where there are two master-detail relationships. But it causes a duplicate ...
-1
votes
1
answer
919
views
validation rule with 3 required fields
I need to create a validation rule when an opportunity stage is closed lost, 3 fields must be filled in and the profile must be different from the director (directors do not need to fill in the fields)...
1
vote
1
answer
238
views
Validation rule not triggered when checkbox is true
I am trying to create a validation rule that prevents a lookup field from being updated/changed when a checkbox on the referenced lookup record is true. I tried to reference the field using the _r but ...
1
vote
2
answers
3k
views
how to make phone field unique
i want to make phone field unique for this i have tried triggers but i want to write validation rule for this i have written something like
AND(
CONTAINS(
VLOOKUP(
$ObjectType....
0
votes
1
answer
2k
views
REGEX Validation Rule to prevent duplicate in set of numbers
I'm working on a validation that would require a user to enter only numbers that have to be exactly 9 numbers and be separated by lines. The below is working for that, but is it possible with straight ...
-1
votes
1
answer
771
views
Validation rule error when using picklist
I have this validation rule that I created but I am getting an error saying
Error: Field Pre_Service_Call_Completion_Status__c is a picklist field. Picklist fields are only supported in certain ...
-1
votes
1
answer
240
views
Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 1 on Validation Rule
I've been getting error on validating my formula to check if an option list has a certain value, and if any of the field has been changed, and I'm getting the error that it only received 1 parameter, ...
0
votes
0
answers
20
views
specific profile cannot change field (validation rule) [duplicate]
I want to create a rule where the User with the "Call center" profile will only be able to fill in the "Name" field just by creating the Customer record. Once the record is created,...
0
votes
1
answer
159
views
How can I replicate NOT(ISBLANK logic for multiple field sets in a validation rule?
I've been racking my brains on this. I have a business case whereby I need to enforce a validation rule on a pair of fields Renewal Date (date) field and Deal Value (currency) field. A user should not ...
1
vote
3
answers
451
views
validation rule to fire on every month last friday in salesforce [closed]
I have a date field called "Next_Visit_Date__c"
Now I want to write validation my next visit is only the last friday of each month if I take any date other than last fire on every month ...
1
vote
2
answers
2k
views
Validation Rule on Multi-Select Picklist to only allow one value
I need a validation rule on a multi-select picklist field that if a specific value is selected, no others can be selected.
Right now I have:
Includes(Multi_Select_Field__c, "Value1")
But ...
0
votes
1
answer
166
views
Validation Rule
I am looking a validation rule to trigger if the opportunity related to the case is of a certain "Type", a certain Status ("Site Survey") is selected and a custom field of ...
2
votes
1
answer
54
views
Help with our Validation Rule on Lead
we currently have a validation rule on Lead as follows:
AND(
AND(
$Profile.Name <>'B2BMA Integration User',
$Profile.Name<>'System Administrator'
),
OR(
...
1
vote
2
answers
262
views
How write formula on Polish TIN (taxpayer identification number) using that like Validation rule
Who knows how best to approach this task. I was asked to add a TIN field to Account. This is the Polish taxpayer number for the firm. This field should be checked to be sure that the user entered it ...
0
votes
2
answers
545
views
No zeroes or blank in fields
I want that when they user move to Stage 1, they have to enter an amount for the MRR and ARR greater than zero(0) and not to leave it blank. I created this validation rule and even if I input an ...
1
vote
0
answers
81
views
I can't find ServiceResourceId field when i try to insert it in validation rule
I wanted to input the ServiceResourceId lookup field in the validation rule on Service Crew Member but I can't find such a field in the insert section. When I tried write it I got error 'Error: Field ...
0
votes
1
answer
103
views
Validation rule firing when it shouldn't
I have this validation that is supposed to prevent non admins from changing the Close Date once an Opportunity is closed.
It seems to be firing when they are changing the stage to Closed Won or Closed ...
0
votes
1
answer
279
views
Help on Account Validation Rule to prevent User from Changing Ownership of Account
I am looking to create a validation rule that prevents a user with the profile "Account Executive" or "Sales Manager" from changing the ownership of a prospect account that is ...
0
votes
2
answers
803
views
Validation rule formula to prevent closed Opportunities with Close Date outside current calendar month/year from being edited
Need: I am trying to write a validation rule that prevents the editing of Closed Opportunities with a Close Date outside of the current calendar month/year, except for certain users. In other words, ...
1
vote
2
answers
8k
views
Validation Rule Conflicting with Flow
I am having trouble with a new Validation rule because it is conflicting with Flow. I am getting this error:
Error Occurred: The flow tried to update these records: 0064V00001LmbdtQAB. This error ...
1
vote
1
answer
84
views
Issue in flow builder
I am working on a requirement where a particular account should have only four contacts if more than four contacts then a validation error should pop up.
Since a roll-up summary is impossible as there ...
0
votes
0
answers
42
views
How to retrieve logged in user's contact-->Account-->Parent-->custom field in validation rule. Is it possible?
I am using below formula to retrieve logged in user's contact's Account's Parent's field in validation rule. It is throwing error that Agency Queue does not exist.
Is it possible to derive this? ...
-2
votes
1
answer
171
views
How to make a field mandatory if we're selecting a particular picklist value
I want to make 'Date' field mandatory if I have 'Level 1 = Points' and under this 'Level 2 = Redemption'
Level 1 is a controlling picklist for level 2.
-2
votes
1
answer
45
views
Formula for Validation Rule [closed]
I'm trying to create a formula for a validation rule where if a checkbox is marked for "Field A" then an email address must be entered in for "Field B". What would a formula like ...
0
votes
0
answers
457
views
Lead Owner Change to User/queue are firing validation rules incorrectly
I have two validation rules
For lead owner change to 'user'
For lead owner change to 'queue'
Here, user validation rule is firing, even though I am changing the owner to queue. How to make system ...
1
vote
2
answers
348
views
Is it normal that a validation rule doesn't work as intended?
We have a few validation rules to protect our records to be modified if they meet the criteria, but a few days ago one of the validation rules stopped working, right now we don't know the exact reason....
7
votes
2
answers
2k
views
Count Line Breaks?
I am trying to count the number of lines in the BillingAddress field. I am familiar with the following methodology to count the number of times a substring occurs via formula:
LEN(TextField__c) - LEN(...
0
votes
3
answers
8k
views
Regex validation for Phone Number
I am trying to create a validation rule for US format number and using the following regex Validation
NOT(REGEX(Phone, "\\D*?(\\d\\D*?){10}"))
The above seems like a standard regex which will only ...
-1
votes
1
answer
842
views
Validation rule with record types and alphanumeric
I need to create a validation rule with several criteria. When creating a new Example ID, the ID must be:
Alphanumeric or alpha only
If the record type is A, it must be 5 digits
If the record type is ...
-1
votes
2
answers
540
views
How to avoid duplicates of records in a field In standard Object using flows or Validation rules or flow builder
For a Product standard object, I would like to avoid duplicates in the Product Name field and Product code field. How can I achieve this using validation rules, flows, or flow builder? Please provide ...
-2
votes
1
answer
54
views
Validation rules check [closed]
I need a help in creating validation rule, I need to throw validation message if a checkbox is checked and corresponding comment is not provided and there are around 10 different checkboxes.
AND(
...
1
vote
1
answer
2k
views
Assign Custom Permission in Test class
I have a validation rule
AND(
ISPICKVAL(Submission_Handover_Process_Status__c, 'Awaiting Validation'),
ISCHANGED(Submission_Handover_Process_Status__c),
NOT($Permission.Submission_Handover)...
0
votes
0
answers
1k
views
How to bypass a validation rule for Automated Process user in tests
I'm trying to bypass a validation rule on Account Object for a test.
It's ok when I create the accounts, I assigned a mocked permission set to the user creating the Accounts with a custom permission '...
0
votes
1
answer
508
views
Prevent change of account owner unless its in your name
Current validation rule which stops account ownership being changed unless you have a system admin profile. I wish to allow account ownership to change if the account is in the users name...any ...
0
votes
1
answer
553
views
Why is using $Profile.Id in validation rule not working?
I created a validation rule to test the insert field. The Profile Id and Name is correct. Supposedly, only system admin can edit the record. However, even if I am logged in as a System Administrator, ...
-1
votes
2
answers
206
views
Validation rule for Date/Time Opened must trigger if a date is greater than 08/10/2022
I am trying to create a validation rule that will work with other criteria however I am stuck on how to create formula for the rule to fire when the Date/Time opened field is greater than 08/10/2022.
...
0
votes
1
answer
240
views
Validation Rule to trigger when Account is made Active and following fields are not blank based on a record type
can I get some advise on below validation rule on Account? I have tried to change it multiple times, but it's not firing when it should.
When the User is trying to make an Account Active by unchecking ...
0
votes
1
answer
2k
views
Validation rule, if the field is blank can be editable
I'm new to Salesforce and I have to allow edit permission to some fields only if they are blank. Otherwise they shouldn't be editable. My validation rule look like this for the moment, I'm a bit stuck....
-1
votes
1
answer
67
views
I need a Validation rule that says if Task Type = Billable, then the task category must not be blank [closed]
I need a Validation rule that says if Task Type = Billable, then the task category must not be blank. both the task type and task category are drop-down boxes.
-2
votes
1
answer
3k
views
Regex for US Federal Tax ID (EIN) [closed]
In the pattern attribute of an input tag, I am using the following regular expression for validation of the US Federal Tax ID field.
pattern="^[1-9][0-9]{8}$"
But this regex allows ...
0
votes
1
answer
635
views
Lightning-edit-form submit only after custom code execution
I am creating LWC which will have both <lightning-record-edit-form> and <lightning-record-view-form> elements. I am toggling between these elements to edit and display the record.
My code ...
-1
votes
1
answer
428
views
validation rule for 2 checkbox
I need Validation Rule for 2 checkboxes. When Checkbox1 = true you can not edit Checkbox2. But I need to have option set True on both checkboxes at one time.
-1
votes
1
answer
265
views
Receiving Syntax error. Extra ',' when adding OR( condition on validation rule
When writing the below validation rule for a custom object, I find that it works for the first half; however, I also need to at the OR( condition for specific Stage values. When I do so, I'm receiving ...
-1
votes
1
answer
50
views
Mulitpicklist validation
HI all I am working on a validation such that if "Other" value in a multipicklist is choosen then a text field B cannot be blank.
AND(ISPICKVAL( A__c,"Other" ), ISBLANK( B__c )). I ...
-1
votes
1
answer
339
views
Get object with specify id from list object in APEX [closed]
I have a list like following:
List<idName> = [idName:[name='AAA', id=1],
idName:[name='BBB', id=2],
idName:[name='CCC', id=3]]
And one input is equal 2;
So how can I ...
-1
votes
1
answer
81
views
Parameter Error, " Error: Incorrect number of parameters for function 'ISPICKVAL()'. Expected 2, received 1 Validation Rules
I created a validation rule, however, one field is giving me an error: Error: Incorrect number of parameters for function 'ISPICKVAL()'. Expected 2, received 1.
Here is the original validation rule:
...