function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
nickfs92840nickfs92840 

% + % = A Validation Rule for 2 percent fields

 

 

I have a custom object with two percent fields. If the "Rate1__c" percentage field has a number entered, but "Rate2__c" is blank and user tries to save, the record should error out and prompt the user to complete the "Rate2__c" field.

I need a VR with this project that is 99% complete and this will save me! lol Thanks!

The API's are:
Rate1__c
Rate2__c

Date Type: Percent

Best Answer chosen by Admin (Salesforce Developers) 
Navatar_DbSupNavatar_DbSup

Hi,

 

Try the below formula as reference:

 

IF( AND(len( text(Rate1__c ))>0,len(text(Rate2__c ))=0) , true, false)

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

All Answers

Navatar_DbSupNavatar_DbSup

Hi,

 

Try the below formula as reference:

 

IF( AND(len( text(Rate1__c ))>0,len(text(Rate2__c ))=0) , true, false)

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

This was selected as the best answer
SabrentSabrent

you could even do,

 

AND(NOT(ISBLANK(Rate1__c)),ISBLANK(Rate2__c))

nickfs92840nickfs92840

Ok, how do I say this? BOTH VR's provided worked perfectly! Thanks gents!