Questions tagged [validation-rule]
Validation rules verify record data meets the standards you specify before the record can be saved.
39 questions
5
votes
1
answer
3k
views
Formula Specific to Running User?
I have a requirement where a certain field can be edited without the validations firing for a particular user. Now I tried to write rule like LastModifiedId != '005000000000000AAA' but the validation ...
3
votes
2
answers
3k
views
Uncheck checkboxes by changing particular checkbox state
I have custom fields in contacts form named checkbox1__c, checkbox11__c, checkbox12__c, checkbox13__c.
When I check checkbox1__c then I want checkbox11__c, checkbox12__c, checkbox13__c to be ...
2
votes
3
answers
2k
views
Salesforce Validation Rule Only Create 1 Record a day
Any idea how to write a Validation Rule, that prevents the user from creating more than one record a day.
I have one Object called (Stundenkonto__c) it shows a Month in Timetracking.
I have a Object ...
2
votes
2
answers
10k
views
Excluding System admin from this validation rule
I have the following validation rule ;
OR(
AND(
Upper(MailingCountry) <> 'UK',
NOT(ISBLANK(TEXT(UK_Email_Consent__c)))
),
AND(
Upper(MailingCountry) = '...
0
votes
2
answers
3k
views
Display error message if same record exist with combination of some fields?
I have taken three fields from case object called AccountName, IntegrationTo__c and SfType__c (checkbox).
I have created one case record with a specific combination of three fields.
For the second ...
2
votes
3
answers
911
views
Validation Rule Assist: Lock down multiple lead fields after they are first populated
I am trying to create a validation rule to lock down our original utm fields on leads after they are first populated.
Essentially I would like to prevent everyone (including our marketo sync user) ...
2
votes
2
answers
3k
views
Can we use custom metadata type records in validation rule in salesforce?
I was trying to use custom metadata type in validation rule.
My use case is i want a restriction on digits in phone number on various objects in managed package.I want to give flexibility to ...
2
votes
3
answers
2k
views
Trigger to prevent insert record between two dates
Hi what I am trying to do is write a Trigger for a custom object where users can pass in a from and to date. Now I am trying to make sure that they can't put another record between those 2 dates i.e. ...
2
votes
2
answers
4k
views
Validation rule on Rich Text Area field
Using LEN() function, we are able to validate if a rich text area is blank, but when a rich text area with image is added, LEN() still say 0.
How to validate whether rich text area field contains ...
2
votes
2
answers
2k
views
Validation Rule on picklist under opportunities
There are 2 requirements:
standard users can’t update the status of a record beyond “open won” (so that only SF Admins or auto processes update “registered” and the stages beyond registration. ...
1
vote
1
answer
6k
views
Error: The ISCHANGED function cannot reference the RecordType.Name field
I am trying to prevent Recordtype from being changed for Account. when I use ISCHANGED( RecordType.Name ) in validation rule, the following error appears:
Error: The ISCHANGED function cannot ...
0
votes
3
answers
3k
views
Add a Profile Exception to Validation Rule
I have written a Validation Rule that I need to include a profile exception in. My rule is below and I can't figure out how to add an exception so that System Administrators can bypass this rule. Can ...
0
votes
2
answers
708
views
Rolling back a complete transaction
I have two object foo__c and zoo__c. zoo__c is a child of foo__c with a master detail relationship. I have validation rule created on Zoo__c with a condition that when the status__c field on related ...
0
votes
2
answers
11k
views
Fire Validation Rule from Apex
Is there a way to fire an existing Validation Rule from apex. Specifically, I want to fire the rule during a "before delete" trigger.
0
votes
1
answer
2k
views
Salesforce.com >> Using a validation rule, how to allow specific user to create a new record on Account and restrict other user?
Salesforce.com >> Using a validation rule, how to allow specific users to create a new record on Account and restrict other users?
In my org, a validation rule is already present to restrict the ...
7
votes
1
answer
18k
views
any way to handle validation rule errors nicely in flows
When working with a visual flow, it seems that when you get an error saving a record because of a validation rule, that the only error Salesforce will give you is:
An unhandled fault has occurred in ...
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(...
6
votes
1
answer
4k
views
Can I use the $Permission variable in a validation rule?
I have an existing validation rule on a custom object that prevents users from selecting certain values in a picklist field, Stage__c, unless their user profile is equal to System Administrator' or '...
4
votes
3
answers
4k
views
Prevent Stage Skipping But Allow Regression
I'd like to prevent users from "skipping" Opportunity Stages, but not from reverting the Stage back. For example, I do not want a user to advance to Stage 5 without having been in Stage 4 immediately ...
4
votes
1
answer
19k
views
Using Permission Set in Validation Rule
Currently I have this in a Validation Rule:
$Profile.Name <> "System Administrator"
I would like to add another condition that checks a Permission Set. I have found a solution that uses Custom ...
3
votes
1
answer
7k
views
Validation rule to test if a field contains only digits
I am trying to set a validation rule to check if a field contains only digits
Tried this condition : !ISNUMBER(myfield__c)
But the user can type 123.123
How to check that each char of the field ...
3
votes
3
answers
3k
views
Opportunity validation rule not firing when fields are blank
I'm trying to get this validation rule on Opportunity to fire off whenever StageName = 'Decline to Bid' AND either Lost_Reason__c(Picklist) is blank OR Lost_Details__c(Text) is blank.
In other words, ...
3
votes
2
answers
10k
views
Determine Case owner is queue or user?
how to check whether a case owner is a queue or a user? I am writing a validation rule where i need to check who is the owner of the case.
2
votes
1
answer
2k
views
How to disable or readonly lookup field in standard page
EDIT:
On a standard page. NOT using VF page
Is it possible to write a validation rule or any approach to make a field disabled once the user save?
I have a page with couple of fields including ...
2
votes
1
answer
1k
views
Validation Rule To Detect Translated Picklist Values?
I am trying to create a Validation rule which will stop closing the case when either the Case Type or Subtype is blank. The formula which I have written -
AND(
OR(ISBLANK(TEXT(Type__c)),
...
2
votes
2
answers
2k
views
How can I create Opportunity Validation Rules without breaking Lead Conversion?
In our Salesforce process, our Opportunities have a custom Picklist field called 'Vertical' to track the industry segment of each Opportunity. I'm trying to make this a required field.
I'd like to ...
1
vote
1
answer
2k
views
Validation Rule on Parent Object blocking any activity on Child records?
I have a Validation Rule on Account, that when reaching a certain stage, several fields need to be filled out. A user couldn't log activities on Contact related to this account due to this Validation ...
1
vote
3
answers
11k
views
Validation rule that includes multi picklist field
I need help with a Validation rule that basically says if Account Type = Customer, and you want to set Account Stage = On going, you have to make sure first that multi picklist field does not contain ...
1
vote
2
answers
2k
views
Restrict Users To create Account Teams on Account object [closed]
only system administrators should be able to add account team member in account object. remaining users should not have the permission to add account teams.
how can we achieve this using validation ...
1
vote
2
answers
3k
views
How to lock date field in opportunity? [closed]
I have few scenarios for locking the date
If Closed:Won – Date locked
If Stage changed to ‘Closed:Lost’ or ‘Declined’ from Closed:Won then date is changed to the date of that activity and locked ...
1
vote
3
answers
6k
views
Skip the validation rules for Opportunity during lead Conversion
The scenario is I only want to validate the field upon record update not creation.It works successfully when I create or update record manually with validation rules.But it fail when I convert the ...
1
vote
2
answers
4k
views
Validation rule to allow modification of limited fields only
I have a object that has more than 40 fields. There are 3 record types and each layout shows different fields.
Now, I want to write a validation rule which allows editing of limited fields only when ...
1
vote
2
answers
2k
views
Validation Rules: Only the status field can be edit
I need a validation rule that prevent user to edit the record when the status is "under approval", however the status can be edit to other values. I tried the formula above, but the syntax is wrong. I'...
1
vote
2
answers
4k
views
How to add Validation rule for whatid
I have a requirement in which for Inactive accounts if user try to edit or create a new task then it should not allow user to save the task. It should throw some validation message.
On the task object ...
0
votes
1
answer
158
views
Validation on Dependent Field in Standard Page
How would I go implement validation on a standard salesforce page?
The validation rules are:
I have the following:
1) Attachment - Checkbox (default checked)
2) URL - Textbox
If the Attachment ...
0
votes
2
answers
3k
views
Validate that a URL begins with
I do not find anyway that you can validate a valid url when the user enters in the standard page so I come up with this validation and I need little help to fix it.
I'm using BEGINS to see if the url ...
0
votes
0
answers
58
views
error with validation rule when making list of past roles
i'm working on making a list of past roles which include a start and end date from when the role was held. however i'm having trouble making it so before adding a new role, the previous role must be ...
0
votes
1
answer
2k
views
How to make accounts read-only / locked?
It's a long story, but we have a group of account in SF that we'd like to make read-only.
Ideally, these records would...
Remain accessible to the same people they were before
No longer be editable
...
-3
votes
1
answer
65
views
Validation rule : Standard users cannot update the status of a record beyond one specific value in picklist [duplicate]
Requirement : Standard users cannot update the status of a record that is already Registered (or post-registered phase). Example: Opp was already “Registered” but some standard user was able to change ...