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
Jaye LoweJaye Lowe 

ISBLANK and Record type

Hey, all I am looking to have a formula field that looks at Record ID and then checks to see if the picklist field level of care is blank and if it is blank than to return a null value in the field. Here is my code. 
IF(
AND(
RecordType.Id = "012j0000000poaT",
TEXT( Level_of_Care__c ) =""
), NULL,

It doesn't seem to be working. Any help would be greatly appreciated. Thanks! 
Best Answer chosen by Jaye Lowe
AbhinavAbhinav (Salesforce Developers) 
Hi Jaye,

I think you are not passing the false criteria for if condition.
I tried to replicate the scenarion in my dev org and it seems working.
IF( AND(RecordType.Id = "0125g000000QND6",TEXT( CustomerPriority__c ) ="") , null,"Its False")

If it helps, Please mark it as best answer.

Thanks!

All Answers

AbhinavAbhinav (Salesforce Developers) 
Hi Jaye,

I think you are not passing the false criteria for if condition.
I tried to replicate the scenarion in my dev org and it seems working.
IF( AND(RecordType.Id = "0125g000000QND6",TEXT( CustomerPriority__c ) ="") , null,"Its False")

If it helps, Please mark it as best answer.

Thanks!
This was selected as the best answer
Jaye LoweJaye Lowe
Thank you so much, but it's still retutrning the values. This is a number field and if the record type is 012j0000000poaT and nothing is selected in the picklist field Level of care than the field I am created should be blank, But I still can't get it to work. Ideas? 
AbhinavAbhinav (Salesforce Developers) 
You said  if the record type is 012j0000000poaT and nothing is selected in the picklist field Level of care than the field I am created should be blank,..... What if this condition is not met? then what should your formula field return
Jaye LoweJaye Lowe
Then it should return the value of 0.5
AbhinavAbhinav (Salesforce Developers) 
IF( AND(RecordType.Id = "012j0000000poaT",TEXT( Level_of_Care__c ) ="") , null,0.5)

try this I think It should work
Jaye LoweJaye Lowe
It should be it gives me this error
IF()'. Expected 3, received 4
Jaye LoweJaye Lowe
Maybe if you saw the entire code it would help: IF( AND( RecordType.Id = "012j0000000poaT", TEXT( Level_of_Care__c ) ="" ), NULL, 0.5, IF( AND( RecordType.Id = "0123a00000117x8", TEXT( Level_of_Care__c ) = "" ), NULL, 0.5, IF( AND( RecordType.Id = "012f10000004ZDm", TEXT( Level_of_Care__c ) = "" ), NULL), 0.5, IF( AND( RecordType.Id = "0123a00000117x3", TEXT( Level_of_Care__c ) = "" ), NULL, 0.5, IF( AND( RecordType.Id = "0123a00000117x3", TEXT( Level_of_Care__c ) = "IOP" ), 0.5/2, IF( AND( RecordType.Id = "012f10000004ZDm", TEXT( Level_of_Care__c ) = "IOP" ), 0.5/2, IF( AND( RecordType.Id = "0123a00000117x8", TEXT( Level_of_Care__c ) = "IOP" ), 1.5/2, IF( AND( RecordType.Id = "012j0000000poaT", TEXT( Level_of_Care__c ) = "IOP" ), 1.5/2, NULL)))))))
AbhinavAbhinav (Salesforce Developers) 
It seems you are using wrong nested if synatx
 
IF(
   AND(
      RecordType.Id = "012j0000000poaT",TEXT( Level_of_Care__c ) =""),
         "Value If Above Condition is true(Your Case its Null)",

IF(
   AND(
      RecordType.Id = "012j0000000poaT",TEXT( Level_of_Care__c ) =""),
         "Value if Second condition is true",

IF(
   AND(
      RecordType.Id = "012j0000000poaT",TEXT( Level_of_Care__c ) ="",
         "Value if 3rd Condition is true",

            "Value if condition not matched")))




Please align you formula as per above syntax. I would suggest add condition one by one and then check syntax followed by adding next condition.

Try to follow above alignment to avoid confusion of closing the bracket
mukesh guptamukesh gupta
Hi Jay,

What adat type of formula field you using , after that i can suggest


 
Jaye LoweJaye Lowe
I figured out, maybe a bit complex, but thanks for all yout help: 

F(
AND(
RecordType.Id = "0123a00000117x3",
TEXT( Level_of_Care__c ) = "IOP"
), 0.5/2,
IF(
AND(
RecordType.Id = "012f10000004ZDm",
TEXT( Level_of_Care__c ) = "IOP"
), 0.5/2,
IF(
AND(
RecordType.Id = "0123a00000117x8",
TEXT( Level_of_Care__c ) = "IOP"
), 1.5/2,
IF(
AND(
RecordType.Id = "012j0000000poaT",
TEXT( Level_of_Care__c ) = "IOP"
), 1.5/2,

IF(
AND(
RecordType.Id = "012j0000000poaT",
TEXT( Level_of_Care__c ) <> ""
), 1.5,

IF(
AND(
RecordType.Id = "0123a00000117x8",
TEXT( Level_of_Care__c ) <> ""
), 1.5,
IF(
AND(
RecordType.Id = "012f10000004ZDm",
TEXT( Level_of_Care__c ) <> ""
), 0.5,
IF(
AND(
RecordType.Id = "0123a00000117x3",
TEXT( Level_of_Care__c ) <> ""
), 0.5, NULL))))))))
AbhinavAbhinav (Salesforce Developers) 
Glad It worked!! Please mark it solved by selecting best answer. 
Thanks!