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
AAIAAI 

validation rule doesn´t show a text value

Hi all,

I would need that if a user select a piclist field value, another text field can´t be blank.

Here is my code. Any help, please?

AND (
ISPICKVAL( Status  , "Unqualified"),
 NOT (ISBLANK( ReasonRejectedByCommercialPlanning__c ))

 )
Best Answer chosen by AAI
LBKLBK
AND (
ISPICKVAL(Status ,"Unqualified"),
ISBLANK( ReasonRejectedByCommercialPlanning__c ))
This should work. I believe you want the text field to be mandatory, only if the Status is Unqualified?
 

All Answers

Niket SFNiket SF
AND (ISPICKVAL(Status ,"Unqualified"),(ISBLANK( ReasonRejectedByCommercialPlanning__c )))
AAIAAI
Sorry Niket,

I tried with your formula and I got the following error "The Reason rejected must be filled" although the field was filled.
buggs sfdcbuggs sfdc
AAI

Please Remove NOT,  From NOT (ISBLANK( ReasonRejectedByCommercialPlanning__c )),then it will work,you need to fire the message when it is blank or null,but in your code you are firing it on when it is NOT(Blank),so its not working,remove NOT from code it will work.
Niket SFNiket SF
Are you sure you are using correct API name ? And there are no other validation tule already on ?
LBKLBK
AND (
ISPICKVAL(Status ,"Unqualified"),
ISBLANK( ReasonRejectedByCommercialPlanning__c ))
This should work. I believe you want the text field to be mandatory, only if the Status is Unqualified?
 
This was selected as the best answer
Akhil AnilAkhil Anil
Hi AAI,

Is your Rejected Reason a picklist field ? If yes, then you need to use the below formula
 
AND(
ISPICKVAL( Status,"Unqualified"),
ISBLANK(TEXT(ReasonRejectedByCommercialPlanning__c))
)

 
AAIAAI
Hi,

The text field is an area text field type.
 I don´t know why it doesn´t work.
I will continue trying.

Thanks
AAIAAI
Hi guys,

Thanks for your answers.

Here is the correct validation rule:

AND (
ISPICKVAL(Status ,"Unqualified"),
ISBLANK( ReasonRejectedByCommercialPlanning__c ))
Peter DrukerPeter Druker
Thanks! You save me a lot of time! User-added image