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
Scott RussoScott Russo 

Help with IF(AND Error - Error: Incorect parameter type for function

I have a formula, number field that I would want to use fieldA or fieldB based on the following.

If the case is closed, and a time stamp field is blank, use fieldA, else use fieldB.  I thought the following code would do the trick, but I receive the following syntax error

 Error: Incorect parameter type for function 'AND()'. Expected Boolean, received Number

 

IF(
  AND(
   IsClosed,
  IsBlank(vrfctnStsHstryStmp__c),
   calcClsd__c ,
  calcCustVrfctn__c
 )
)

 

------------------------

This code works fine.

IF(
   IsClosed, ,
     calcClsd__c ,
  calcCustVrfctn__c
 )

What am I missing?

Best Answer chosen by Admin (Salesforce Developers) 
yvk431yvk431

THink you didnt closed the AND() properly,

 

IF(
  AND(
   IsClosed,
  IsBlank(vrfctnStsHstryStmp__c)),
   calcClsd__c ,
  calcCustVrfctn__c
)

 

--yvk

All Answers

yvk431yvk431

THink you didnt closed the AND() properly,

 

IF(
  AND(
   IsClosed,
  IsBlank(vrfctnStsHstryStmp__c)),
   calcClsd__c ,
  calcCustVrfctn__c
)

 

--yvk

This was selected as the best answer
Scott RussoScott Russo
That was it. Thank you for the quick reply.
Cheers