0

I would like some validation rule formula help please:

When a standard end user profile tries to save an opportunity (standard opportunity record type), either the "APR" field OR the "Factor Rate" field must be populated. Here is what I have but I am getting an error: "Error: Incorrect parameter type for operator '&'. Expected Text, received Boolean."

Record_Type_Name__c = 'Other Financing Opportunity' 
&
$User.ProfileId = $Label.SmartBiz_Standard_End_User_ID
&
(!ISNULL( Rate__c ) || (!ISNULL( True_APR__c )))
1
  • I've edited out what feels like a statement that is a misrepresentation.
    – Derek F
    Feb 3, 2023 at 19:35

1 Answer 1

1

& (a single ampersand) is the string concatenation operator (+ can also be used to concatenate strings).

&& (a double ampersand) is the "boolean and" operator, and is what you meant to use here (just like how you use ||, double pipes, for "boolean or").

The alternative here would be to use the AND(), OR(), and NOT() functions, which can be easier to read and less to type

AND(
    Record_Type_Name__c = 'Other Financing Opportunity',
    $User.ProfileId = $Label.SmartBiz_Standard_End_User_ID,
    OR(
        NOT(ISNULL(Rate__c)),
        NOT(ISNULL(True_APR__c))
    )
)

Note that via DeMorgan's law, you can replace (!x || !y) with (x && y), which I feel makes things less obtuse in this case (and removes the need for the OR())

AND(
    Record_Type_Name__c = 'Other Financing Opportunity',
    $User.ProfileId = $Label.SmartBiz_Standard_End_User_ID,
    ISNULL(Rate__c),
    ISNULL(True_APR__c)
)
1
  • I knew it would be something as simple as the "&&". Thank you so much for your help, Derek!!
    – Jenna Odom
    Feb 3, 2023 at 19:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .