Questions tagged [validation]

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

Filter by
Sorted by
Tagged with
-1 votes
1 answer
39 views

I am trying to create a validation rule to verify the field 'Occupancy' so that a Booking is only active based on the Occupany

I am trying to create a validation rule on my Booking object so that the Booking can only be active if the Occupancy status on the Booking is either In House or Temporarily Vacated or Blocked out or ...
2 votes
1 answer
170 views

Validate deployment of a multi-packaged project using source:deploy

We have a large project that we took over and we are in the process of modularising the source into separate packages. At this point we're not quite ready with the metadata sorting to actually create ...
  • 393
0 votes
1 answer
36 views

Validation For Picklist [closed]

I have picklist Name Status__c and values are Active, Canceled, Closed And other filed is Amount__c. My requirement is when I choose Canceled or Closed values from Picklist the Amount filed should not ...
user avatar
0 votes
1 answer
714 views

phone field validation for starting with + followed by country code and phone number

I am trying to implement the phone validation for lightning flow screen. Here is what i tried and it's working in https://regex101.com/, But when am trying to save in lightning flow screen input ...
0 votes
2 answers
236 views

Issue with after update trigger

I have a trigger which creates new Cust_Alert_record when Policy__c record is updated. Below is my trigger: trigger AlertTextforContact on Policy__c (after update) { List<Cust_Alert__c> ...
1 vote
0 answers
295 views

Flow Input Validation Not Firing

I am trying to implement what should be a fairly simple validation on two inputs in a flow. There is a picklist called {!Input_Type} which can have one of three values ({!CRS}, {!Email}, {!NewCustomer}...
  • 505
0 votes
2 answers
1k views

Need help with Validation Rule in Master Detail relationship

I am new to Salesforce and need help in writing a validation rule. I have a Master object that can have multiple child objects.The child object has a field 'Type' with value lets say X and Y. If one ...
  • 1
0 votes
1 answer
206 views

Check if record exist with specific value when creating one

I took over for a Salesforce Admin and I am pretty new as an admin, but have used Salesforce as a salesperson before. We have a custom object called Logs, and our non-profit has case managers that ...
  • 11
0 votes
1 answer
522 views

Throw error for special character

I want to throw error message when there is a special character in the user input.I tried following, var re = new RegExp('[-!$%^&*()_+|~=`{}\[\]:";\'<>?,.\/]'); console.log('@@ special ...
  • 2,156
0 votes
3 answers
138 views

Will an apex update on a different object trigger validation rule?

I have a problem with a validation rule not being triggered. Object A trigger updates Object B Object B has a validation rule. Will the validation rule fire?
  • 1
0 votes
1 answer
113 views

How can I make a field mandatory to fill when I create a Lead record using standard button?

When I click on the new button on Lead object (which is a standard button) page. It opens a standard Standard page. How to make a field mandatory on a standard page? Is there any other way apart ...
0 votes
1 answer
660 views

How can I bypass Validation Rule for incoming APIs? Can $User.UIThemeDisplayed do the job?

I have the following formula in my Validation Rule on Opportunity. The rule should only apply to Lightning and Classic users, but not to incoming APIs. I thought this would allow APIs by without ...
0 votes
2 answers
439 views

checking field update on multiple child records

I have a requirement to check Terminated__c flag on multiple child records (lead_Custom__c) and if it is true, then update the Terminated__c flag on Parent record (contact). Below is the apex class: ...
  • 73
0 votes
1 answer
414 views

Issue with Lightning Dashboard formula

I have a report which is grouped using a custom field called Type__c. It holds two values, RN and NB. Now, I have created a formula in the lightning report to get the percentage of each record count. ...
  • 73
0 votes
1 answer
498 views

Unable to set dependent picklist field as mandatory in lightning component

I have a controlling picklist field called Interaction Result and dependent picklist called Interaction Reason which i am displaying in lightning component. Now, I want to set the child field as ...
  • 73
1 vote
1 answer
802 views

Validation rule for age in years, months and days

I want to ensure that the age of my contacts be less than 20 years, 5 months and 15 days. Till 20 years and 5 months, I am able to write the rule by multiplying the years with 12 and adding the months ...
  • 313
0 votes
1 answer
39 views

Trying to write a VR to prevent all but one role from updating a record to status of complete

I suspect I'm making this harder on myself than I need to, but we have an object called "Portfolio__c", and there are several statuses available: "Approval", "Received", ...
  • 1
0 votes
1 answer
46 views

Call Controller Method without triggering required="true" validations

hoping for some guidance on how i can accomplish something in VF. Basically i have 2 SelectLists side by side where the left one contains a list of all SFDC users in my instance and the right one ...
  • 1
0 votes
1 answer
572 views

Validation rule on Picklist value on Global Action

I have created a Global Action 'Log a Call Custom' Here on the Task object I have a Picklist field Subject with four values - 'Please Select 'Option 1' 'Option 2' 'Option 3' The default is 'Please ...
1 vote
0 answers
346 views

lightning input type = date, max attribute behaviour not similar in production and lower enviornment

I used max attribute of lightning input type date to disable the future dates in date picker. It was working in lower environments, but not working in production. In Lower Environments: It shows the ...
0 votes
2 answers
1k views

addError not displaying correctly on Apex Class validation

I am trying to create some Apex validation that checks to see if there are any open Work Orders on a Case before allowing to close. The logic works, however, the error is not displaying correctly. ...
  • 187
0 votes
2 answers
120 views

Validation not working as expected for opportunity stage traversal

I have the following validation logic: IF(AND(TEXT(StageName) = 'Agreement', NOT(PRIORVALUE(StageName) = 'Qualification')), true, false), the Idea is if your current stage is Agreement and you prior ...
  • 466
0 votes
1 answer
1k views

Validation Rule Help on Record Type

need to create a validation rule for record type to restrict the user from creating leads with 2 conditions, one when the email is blank and another when (screening pick value is unscreened and ...
  • 3
0 votes
0 answers
113 views

Persist text validation error message?

Is it possible to persist a validation error message on a lightning component? For example, if you get a validation message of some kind on child A in an accordion, then collapse it and open child B, ...
0 votes
1 answer
139 views

Reached maximum number of Object references on Case, what exactly is causing it?

I've encountered a common error on Case but am having some trouble understanding exactly what it is that is causing it, is it previous related object references in other formulas, validation rules, ...
  • 711
1 vote
1 answer
111 views

add error from trigger when enabling partner user from contact

Is there is a way to stop / add error from contact trigger when a user try to create a partner user from contact ? I would like to add error in case certain field say firstname is missing on contact, ...
  • 127
0 votes
1 answer
62 views

Unusual Request: Prevent Navigation away from Opportunity

I've never been asked this before, and from what I've seen there isn't much out there. Problem Users are not completing their tasks on an opportunity before moving to the next sales opportunity or ...
  • 1,328
0 votes
0 answers
111 views

Deploying Apex Method with Field History, the returning string has error List Index Out Of Bounds 0

I have this with 100% code coverage in sandbox and am trying to deploy to production via change set. When validating this method with test class in production it is showing only 70% code coverage ( ...
2 votes
2 answers
4k views

Validate Input for LWC in Flow Builder

tl;dr - How does one get input validation to work for an LWC in the flow builder? Background I have created an LWC for text input that will alert the user when they are approaching or have exceeded ...
  • 638
0 votes
1 answer
50 views

Validation rule to execute only when the income implementation date is not null

Validation rule to execute only when the income implementation date is not null and income implementation date should be greater than year's limit effective date and less than 45 days from year's ...
1 vote
1 answer
2k views

Formula to cut the strings from a field

I have a field where the name will be stored as "Account A acquired Account B". Now from this field, I need the word to be split in two parts for two different field. one is before acquired and one ...
  • 131
0 votes
2 answers
236 views

get Dynamic Organisation Id in validation Rule

I want to implement validation rule whew i need to check organisation id. My validation rule contains (organisation.id='005223323') Can anybody tell me is there any way to take the organisation id ...
  • 1
0 votes
0 answers
2k views

Validation on blank date field not working

If the opportunity is marked as Closed Won and the opportunity information picklist is set to "Existing Customer Renewal" then the renewal date field cannot be blank. AND ( ISBlank(...
0 votes
2 answers
490 views

Validation rule for only One record per day

Can anyone help me with a validation rule, which prevents the creation of more than one record per day? I have tried using different Validation rules, but none of them worked as expected. I know this ...
0 votes
1 answer
273 views

How to restrict all the Contact Name fields using validation rule?

Tried creating a validation rule as below,but i still can edit the suffix, salutation on page layout. how to restrict salutation,Suffix, do they have any api names for this or should i consider ...
0 votes
2 answers
3k views

How to check for null values for all variables of a custom apex wrapper?

I have a wrapper class written in following manner class Wrapper{ String name {get;set;} Integer age {get;set;} EduWrap edu {get;set;} public String returnTest(){ return '...
  • 313
0 votes
1 answer
165 views

Multi-select picklist validation rule checks against position in the multi picklist instead of values

Hope you are all fine, I'm doing a validation rule over a multi-select picklist that should avoid to be changed on certain substatus. Validation rule is a as follows: AND( $Profile.Name <>...
1 vote
0 answers
181 views

Database.saveResult showing only one error at a time

I am trying to write an apexrest service that takes in fields for the Opportunity Object. There are certain restrict picklists on the Opportunity object that I've created. Additionally there are other ...
  • 313
0 votes
1 answer
74 views

I need to call the trigger from the class that has a validation rule to populate one of the two custom fields

I am trying to call the class in my trigger that validates that only one of the custom fields must be populated and that custom fields cannot be empty. Below is my class and trigger, that shows of the ...
0 votes
0 answers
374 views

Lookup field missing from matching rule

Wanted to have a have a matching rule where if a combination of fields already exist throw a warning. So there are 3 fields in the rule. Text field and Picklist are visible but the lookup is not. I ...
  • 393
0 votes
1 answer
272 views

How to handle system validations in apex?

Created a dynamic form in modal popup based on the fields for a object One of the field's datatype in the form is number When user hits save button we have handled to close popup onComplete after ...
2 votes
0 answers
767 views

Querying for Validation Rules and Workflow Rules by criteria

I'm trying to query for all Validation Rules and Workflow Rules that have a specific value in the criteria. From developer.salesforce, I see that I can query Validation Rule, but I need to filter ...
0 votes
2 answers
5k views

lightning-input-field Error in $A.getCallback() [t.checkValidity is not a function]

I have a requirement to build a custom layout in LWC, and for that I am using lighting-record-edit-form and lightning-input-field with the required attribute. When the user tries to submit the form ...
  • 95
-1 votes
1 answer
45 views

Validation using Multi Select Picklist [closed]

I have Penthouse Object. In that, I kept Amenities as multi select picklist field. According to my task, Three of my amenities such as "false ceiling, wooden flooring and french windows " should be ...
  • 1
-1 votes
1 answer
61 views

Validation Rules [closed]

I want to write a validation rule for different record types with different conditions. Example: I want to validate the selling price of flat and penthouse records types which are on a single object. ...
  • 1
0 votes
1 answer
504 views

Regex validation for birthdate in the format of mm/dd

I have a custom text field with a max length of 5 characters and I'm trying to use regex to enforce a date entered in the format of mm/dd. Two digits, then a "/", followed by two digits. I was trying ...
  • 2,375
0 votes
1 answer
781 views

Validate text filed to display phone number in (999) 999-9999 format

I want to input the mobile number in the Text field after saving the record the mobile number should display in (999) 999-9999 format. I've tried creating a formula field of text and gave the below ...
user avatar
0 votes
2 answers
1k views

Why would you ever use workflow field updates if custom validation rules are in place? [closed]

I have been researching on what is the better of the three (Triggers/Workflow/Process Builders) to make field updates or to perform any action which can be performed by all the three tools. However, ...
0 votes
1 answer
67 views

How to pass the parameter from trigger to validation rules?

I have a trigger on Contract Object, whenever the Contract record is updated the contract section in the associated opportunities will also get updated with the latest Contract data but while updating ...
1 vote
2 answers
273 views

How to add a Validation such that only one of the 2 fields has to be filled in Aura component?

I tried following the tutorial here https://www.sfdcstop.com/2018/03/salesforce-lightning-tutorial-part-5.html but got stuck as below. a.cmp ... <td> <lightning:input aura:id="...
  • 1,107

1 2 3
4
5
20