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
1answer
34 views

Prevent Close Date Change Except Current Quarter?

I need validation rule to stop users from editing Close Date if Opportunity is in "Commit" category, except Admin. But if the date changes in a range of current Quarter then it is okay to make change. ...
0
votes
0answers
29 views

prevent malformed id or invalid Id saved for lookup fields

When creating a new record of custom objectA, there's a lookup field orgAccountId binding to account. Regular way is: enter orgAccountId such as 0000001 in the field, press enter, and it will search ...
0
votes
1answer
27 views

please help with approval process!

Need help! I am trying to do an approval process, that will be triggered automatically from process builder. The problem I have, is picklists. I want the approval to go out automatically on the ...
0
votes
1answer
14 views

Does execution log show all validation rules occur in each iteration or not?

In the image above every iteration has its validation rule occurred, I wonder if there were more validation rules, does the execution log show all of them in every iteration or show only one ...
0
votes
1answer
26 views

Validation Rule trigger

Hi i am trying to restrict the user to change the Acc_Id on the basis of certain field. Below is the code : not working. If yyyyyyyy__c = true Suuuuuu__C = "Complete resolve No one should be ...
-2
votes
1answer
28 views

How do I prevent user saving a lead record if lead status is open? [closed]

New to Salesforce, trying to build my experience and knowledge with some basic freelance work, any help is appreciated!
0
votes
2answers
48 views

One or Nothing Validation Rule

Need to create a validation rule that will evaluate 5 picklist fields and this are the requirements: Only one field can have a value regardless which one of the 5 fields all fields can be blank This ...
0
votes
1answer
31 views

Validation Rule with $Profile

I want to create a Validation Rule that must fire when Account Name is changed and profile is different from ProfileId_1 and ProfileId_2. I tried with different validation rules, but none works: ...
-1
votes
1answer
12 views

Multiple Validation Rules Not Working

I am trying to require certain fields when a checkbox is selected but whether the conditions are met are not, I am getting an error. I am no SF admin and am trying to figure this out on my own. Please ...
0
votes
2answers
22 views

Validate Lead RecordType matches Target Opportunity Record Type before Converting

Scenario We have two types of opportunities and two types of leads. The two opps are for different business processes related to the customers specific needs. We currently have sales agents able to ...
0
votes
1answer
11 views

Avoid or prevent Lead edition when status is “Qualified”

I have the next requirement: When users set lead to 'Qualified', I want a way to prevent them to editing any field. I've tried some things like validation rules like this: ISPICKVAL(PRIORVALUE(...
0
votes
1answer
19 views

Checking for multiple values with CONTAINS

I'm trying to condense this validation rule formula: OR( CONTAINS( Email , "example@gmail.com"),CONTAINS( Email , "example2@gmail.com") I want to use || logic but I'm receiving this error: Do I ...
0
votes
1answer
19 views

Scoring fields - No partial scoring can be entered in the section of fields

I have a section of scoring fields to enter score. Once a score is entered, it cant be editable by anyone else except Administrator. No Partial Scoring can be done on the fields. Once they edit one ...
0
votes
0answers
18 views

Validation to require Product B to have 2 times the quantity of Product A, and not allow adding Product A without Product b?

Trying to come up with a validation rule to only allow product A to be added if Product B is also added to the opportunity, AND then ensure Product B's qty is 2* product A's qty?
0
votes
2answers
34 views

Validation Rule with multiple picklist fields

I need to create a validation rule that fires where when either "Complete" or "Closed" is chosen from a picklist, another picklist becomes a required field. I have tried multiple options, but have not ...
0
votes
1answer
12 views

Make picklist value setable on creation or by admin only

I have a picklist of stages - let's use the example stages below: Unqualified <- Default / Record creation state Qualified Enrolled Under Review Active Where as this record progresses through the ...
0
votes
2answers
39 views

REGEX Validation rule for multiple lines of dates

I'm trying to find a regex pattern for a validation rule on an opportunity that will allow dd/mm/yyyy one or more lines in a long text field named Dates_offered__c. For example, I want to allow: dd/...
0
votes
1answer
24 views

Setting Contact mandatory in Cases

Our org Cases in SF, contacts are not set as mandatory. I want to set it to mandatory by using a validation rule to associate with Contacts. But the validation rule will not work, as we have designed ...
0
votes
0answers
20 views

Can I add custom error message on visualforce page instead of standard error message thrown by validation rule at the top of visualforce page?

Controller: Database.SaveResult[] sr = opportunityhandler.createOpportunity(oppObj); isErrorOcurred = checkErrorsInResult(sr); System.debug('isErrorOcurred>>>'+...
0
votes
1answer
81 views

validation rule on when case status is closed then not possible to re-open

my requirement is : When case status is Approved or Rejected , then not possible to re-open the case and show alert like "Approved / Rejected cases not possible to open...." How can we acheive through ...
0
votes
0answers
16 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 ...
3
votes
0answers
28 views

Custom Permission in Validation Rule evaluating as Null when assigned

We have a requirement to prevent changes to a contract record once active unless the you are a contract admin, which can span multiple profiles. I'm trying to accomplish this by using a custom ...
0
votes
1answer
61 views

can too many validation rules cause a performance issue with large data - Apex CPU Time?

I have a bulk update process which effects updates records in more than one salesforce objects like - Account, Contact, Contract , Opportunity and Oppt Line Item. This bulk process does not update ...
0
votes
1answer
34 views

How to display validation rule error message for opportunity multi line layout?

I am have requirement to display error message while adding opportunity products in multi line layout. i have created validation rule with respect to condition on custom fields which are added to ...
1
vote
1answer
35 views

My Validation Rule isn't working properly

I have a custom object that track several products, but none are required to be filled out. However, if there is a product, I want to make sure my users are inputting all the necessary information. So ...
0
votes
2answers
58 views

Validation Rule on Lead Conversion

I have a validation rule on Opportunity that I want to fire only when a new opportunity is created without Lead Convert process. It should not fire when an opportunity is created using Lead conversion....
0
votes
1answer
30 views

Validation Rule - Picklist being ignored

I am trying to create a validation rule that has multiple sets of criteria, one of them being preventing the LeadSource picklist field from being blank. Below is my formula which for some reason ...
0
votes
2answers
32 views

Validation Rule-If Active checkbox in unchecked, then Reason for cancellation is mandatory Applicable only to record type End Client

This is the Validation for Account Object -Person Account If Active checkbox in unchecked, then Reason for cancellation is mandatory Applicable only to record type End Client And I have written the ...
-3
votes
1answer
28 views

Write a Validation Rule [closed]

In lead object Feilds called Industry,So seleted Industry Feild On Banking Then get error How to do this through Validation Rule
0
votes
1answer
26 views

Validation Rule for Phone with Extension

I'm trying to write a validation rule for phone numbers with extensions. I want to be sure there are exactly 10 integers to the left of the letter "x". It needs to ignore special characters and only ...
0
votes
1answer
29 views

Encrypted Text Field - Validation Rules - multiple Rules

I am using a encrypted Text Field. List of rules needed: Must be able to save a record if value is blank OR Must be Numbers Minimum of 10 Digits Max of 12 - (implemented with length setting) ...
2
votes
2answers
51 views

FIELD_CUSTOM_VALIDATION_EXCEPTION even when all validation rules are deactivated

I have a difficult troubleshooting situation involving a new accounting managed package, a complex flow, a mysterious validation error, and unit tests. I had built a custom REST API before the ...
1
vote
1answer
23 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
19 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
45 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
128 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
31 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
43 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
1answer
53 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
17 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
69 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
17 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
46 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
36 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
25 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
452 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
38 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
86 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
74 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(...