Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [validation]

Validation rules help assure entered data meets basic requirements for consistent and clean data.

-3
votes
1answer
27 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( $...
0
votes
1answer
35 views

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

I am getting the error below for a validation rule. What am I missing? Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 1 If your role is one of the 5 listed and you ...
1
vote
1answer
32 views

Aura Component Field Validation Error

I am tryin to handle field validation for a lightning:input field in a custom aura component. I've referenced the validating fields documentation with no success. I find my lightning:input component ...
0
votes
2answers
40 views

Salesforce - Data Validation - last character must be a letter

I need a data validation formula to say, if status is "Registered" and ID is 6 characters long, the last character of the ID must be a letter. I have managed to get this far but come to a brick wall; ...
0
votes
1answer
22 views

Salesforce EventLogs for Field & Validation changes

does anybody know if salesforce eventlogs picks up logs for whenever a user adds and new field or makes changes to a field on application? Would this show in transaction logs? Here's an example: Bob ...
1
vote
1answer
36 views

.set and .setCustomValidity not working for two checkboxes

I am trying to place a custom validation if atleast one of my checkboxes is selected or not. and show the relevant error message. I am able to achieve this when there is only one checkbox , HOWEVER ...
1
vote
1answer
24 views

How to make adding product mandatory while creating an opportunity and opportunity stage is won

I want to make adding product mandatory while creating an opportunity and when the opportunity stage is won. I have written on validation rule but it is allowing user to save the opportunity by ...
-1
votes
1answer
23 views

Validation on fields results by a SELECT query

I need to make a validation of the results query of many fields. Today this validation is being made one by one, in such effort that, in my opinion, could be less if we used a function and a list or ...
0
votes
1answer
38 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
0answers
32 views

How can I validate a Password during the creation of a new User in Apex?

I would know if there is an Apex method to validate a Password during the creation of a new User in Apex. I found the method Site.validatePassword(user, password, confirmpassword) but it's available ...
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
24 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 ...
2
votes
2answers
165 views

Lightning Web Component Custom Errors

I'm trying to do some custom validation on submit for a Lightning Web Component. I'm trying to use the setErrors method for a lightning-input-field (https://developer.salesforce.com/docs/component-...
1
vote
0answers
28 views

Validate inputs on server side

BACKGROUND I am working on a lightning component which is a simple form that takes from, to emails and a message body as user input and passes this data to an apex controller. Apex Controller ...
0
votes
0answers
19 views

Not able to show error message below the dependent fields in lightning only & it is getting in classic

In classic for the dependent fields, the validation is firing good & in lightning also it is firing well. But, in lightning when the first field has value, then the second field which is dependent ...
0
votes
0answers
12 views

Standard text field throw error on inputting and not after save button is clicked

Billing Country is a standard compound field where on typing value , is there a possibility to throw an message rather than on save throws like validation rules.
1
vote
0answers
29 views

is element validity object is extendable?

I want to extend element.validity, so that can add more custom error type in that. Tried many ways to copy or deep copy and Object.create element.validity but seems like its not possible ... @api ...
1
vote
1answer
30 views

How to compare two IDs of different objects in testing? [closed]

Getting a failure error after running the test class... System.DmlException: Insert failed. First exception on row 0; first error: FIELD_FILTER_VALIDATION_EXCEPTION, Value does not exist or does not ...
0
votes
0answers
20 views

Prevent records from getting updated if there is related case with a record type Complaint

I have a an object . I have created a look up on Case for that object so that it shows the related case with a complaint record type case . Now I want users to close the case before proceeding to ...
0
votes
0answers
62 views

Cannot set <force:inputField> validation error on field in custom quick action lightning component

I have designed a quick action lightning component to clone one of our [complex] custom objects. The requirements are: Add a lookup field where the user would be able to choose another parent ...
2
votes
0answers
135 views

HTML <select> required Attribute not working in Visualforce?

I'm trying to implement a form with a required drop-down list on a VF page, as described in this example. If you click on the link above and run the sample, it works fine but when I try to implement ...
0
votes
0answers
25 views

How to validate lookup lightning input field in record Edit form

I have a record edit form with multiple custom lookup fields. Standard validation rules on lookup fields with an invalid input would give an error message "An invalid option has been choosen". Looks ...
0
votes
0answers
24 views

Need a small regex help

Needed some help while constructing the below pattern for salesforce contact Phone Field Condition1: must start with ‘0’ Condition2: can only be followed by digits and spaces. Condition3: minimum ...
0
votes
1answer
92 views

<lightning:input type=“date” validation

I need to put a validation on lightning input field date. It is a date of birth field and it should not accept date beyond system.today(). Basically the validation will be date_Of_birth > Today() , ...
2
votes
1answer
39 views

Validating Apex method parameters

Is it a good practice to validate method parameters in Apex methods? In C# and Java you generally validate against nulls and throw argument exceptions to prevent usage errors. I don't seem to see that ...
0
votes
2answers
171 views

How to limit picklist values based on Role?

I have added a value to a picklist that is dependent on the value of another picklist. I have added the same value to a different picklist. It is added for particular record types. When the user of a ...
0
votes
1answer
25 views

how to create validation to restrict the owner based on Role

I have validation rule on Account, there is a picklist channel.If the the picklist channel equals to Direct then no role can edit or create the Account record except the owner 'sales executive' role.i ...
-3
votes
1answer
37 views

Validation Rule for Picklist

Hi Req as follow : There is two Picklist Values Filed safety Check and Unit Safety Check and another picklist value as Status : Hence Status must be in the "In Progress" state when there must be some ...
0
votes
1answer
23 views

Validation rule for non testing context

In Apex to separate code execution for test and non-test context we use the following method Test.isRunningTest() Do we have any such thing for validation rules i.e the validation rule should be ...
0
votes
2answers
58 views

Validation Rule to check PRIORVALUE

I am writing one validation rule where status is Pending/In Progress and I am changing any value from record then I need to throw an error 'you cannot edit the record'. AND(OR( ISPICKVAL( Status , '...
1
vote
2answers
83 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
2answers
40 views

Identify existing records which fail a new validation rule

After adding a new validation rule, existing records may be 'invalid'. This causes issues for me because processes and batches will fail to update those records. How can I identify which records are ...
0
votes
2answers
122 views

Validation Rule text field required when multi-picklist value is selected

I'm trying to have a text field required when a value is selected in Multi-picklist field IF( AND(TEXT(Environment_Access__c ) = "DevQA", ISBLANK( Business_Justification__c )), True,...
-6
votes
1answer
40 views

Salesforce Validation Rule [closed]

I have a requirement that in Filed client_Logo__c(URL) whenever user enters any URL : IF it dosen't begin with http or https then it must throw a validation error.
0
votes
1answer
33 views

Validation rule that flags if File is not present on custom object?

Requirement is to prevent saving of a record if a File (in this case, a quote) is not attached. Is this accomplishable declaratively?
0
votes
2answers
54 views

Eliminate consecutive two dots

How to eliminate consecutive two dots in validation rule and 1st char should not be . [dot] example: sal..esforce - invalid sal.esforce - valid .salesforce - invalid salesforce. - valid ...
0
votes
1answer
143 views

Add validation to managed lightning button

I have a managed (detail page button, content source: visualforce page) button which when clicked opens a visualforce page, I want to make this button shows a message if a field on the object is ...
2
votes
1answer
80 views

Validation Rule with both AND/OR logic

I need to require the Length of SOW field to be entered if the opp is not in Long Range Forecast or Discovery stage. If I just have one of the stages in the formula, it fires just as expected. Once I ...
1
vote
2answers
280 views

Required field validation error message in VF Page using Javascript? (No Alert box or Popup's)

I want simple message 'Complete this field' (as shown in image below) to displayed under input boxes which are empty while submitting the form in VisualForce page. Can someone tell me how to ...
0
votes
1answer
137 views

Validate a form with Apex and server side controller

what function can I use when I need to validate a form with Apex on the server side controller? I can't find functions on the internet. This is my code: View: <form class="slds-form--stacked"&...
2
votes
3answers
154 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) ...
0
votes
1answer
34 views

Validation rule to prevent all other users from changing lead status when lead is “New”

I am trying to create a validation rule to prevent users that aren't associated with the user Id profiles from changing a "New" Lead Status to any other status When I check the syntax for the below, ...
0
votes
0answers
11 views

Null result on parent Account field [duplicate]

I would like to compare a field on the Opportunity to one on the Account to validate them. My string AccountClassif = o.Account.Account_Classification__c; is debugging as NULL when it has a value. ...
0
votes
1answer
27 views

Dynamically set apex:inputField required attribute while using CSS to hide/show field

How do I dynamically set the required property on apex:inputField while using CSS to show/hide said field in order to avoid the validation error upon saving a form that has said field as hidden AND ...
0
votes
0answers
107 views

Related Lookup Filter Deployment Issue

I am trying to validate Knowledge__kav object and it has related lookup filter to some other custom object. This validation is done through ant. The issue occurs when i try to deploy this related ...
0
votes
1answer
557 views

Validation Rule to make picklist field mandatory based on picklist value selected?

I have a Primary Department picklist that controls a Division picklist. I need the Division field to become mandatory if the Primary department picklist equals "Medicine", "Surgery", or "Pediatrics". ...
1
vote
1answer
396 views

Issue - Picklist fields are only supported in certain functions

I am working around salesforce's formula field in Process Builder, to compare two fields values. For instance, the field Contact_A__c and Contact_B__c are picklist field types. I am attempting to ...
0
votes
1answer
63 views

Ignore validation on before update/insert trigger?

I have a before insert/update validation trigger which I would like to be able to ignore when doing mass updates via data loader. Figured if I just add criteria of "checkbox field = true, ignore ...
1
vote
1answer
538 views

Lightning component flow custom validation error message

I'm following the instructions here to create custom validation for a Lightning Component in my Flow: Available For Flow Screens Custom Validation Salesforce validates each flow screen when ...
1
vote
1answer
82 views

Login Page Validation - AMP Script

I have a requirement to validate the credentials in the login page for the data in one the DE that I have for the client. I have created a login page in cloud pages/ landing pages ( salesforce ...