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
vikas  malikvikas malik 

Validation help needed

So i have written a valdiation rule below as follows,

IF
(
AND
(
NOT(ISBLANK(SmartAuction_Number_of_Contracts__c)),
ISBLANK(Smartauction_Amount_of_Current_Exception__c)

), true, false
)


Its working fine , but another requirement is

Even if the value is "0"  for the field "Smartauction_Amount_of_Current_Exception__c"  also it should not save it should have a valid number apart from "0" 


Help me how to achieve this 
Best Answer chosen by vikas malik
Gaurav NirwalGaurav Nirwal

Could you check if this works
if(
and
(
not(isblank(SmartAuction_Number_of_Contracts__c)), or(isblank(Smartauction_Amount_of_Current_Exception__c),Smartauction_Amount_of_Current_Exception__c=0)),true,false)

All Answers

PratikPratik (Salesforce Developers) 
Hi Vikas,

Try this,

IF(
AND
(
NOT(ISBLANK(SmartAuction_Number_of_Contracts__c)),
OR(ISBLANK(Smartauction_Amount_of_Current_Exception__c),(Smartauction_Amount_of_Current_Exception__c=0) )

), true, false
)

If it's text field put "0".

Thanks,
Pratik

P.S. If this answers you question, please mark it as "Best Answer" so it will help other community members too.
Gaurav NirwalGaurav Nirwal

Could you check if this works
if(
and
(
not(isblank(SmartAuction_Number_of_Contracts__c)), or(isblank(Smartauction_Amount_of_Current_Exception__c),Smartauction_Amount_of_Current_Exception__c=0)),true,false)
This was selected as the best answer