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
Tim Coates 6Tim Coates 6 

Why am I getting Incorrect parameter type for function 'IF()'. Expected Boolean, received Lookup(User) error

I'm getting the following error when attempting to created this custom formula field on the Opportunity object:

LMS Opportunity Owner Auto-Poulate = 
IF(
INCLUDES(Products_of_interest__c, "Learning Management System (LMS)"),
INCLUDES(Products_of_interest__c, "Schoology LMS"), 
Account.LMS_Account_Owner__c)

Conditions are to set the LMS Opportunity Owner to the LMS Account Owner if Opprotunity Products of Interest = Learning Management System (LMS) or Schoology LMS.

The formula above is giving me the following error:  Incorrect parameter type for function 'IF()'. Expected Boolean, received Lookup(User)

What am I doing wrong?
Maharajan CMaharajan C
HI Tim,

Try the below formula:

IF(
OR(
INCLUDES(Products_of_interest__c, "Learning Management System (LMS)"),
INCLUDES(Products_of_interest__c, "Schoology LMS")), 
Account.LMS_Account_Owner__c,FALSE)

I hope the  Account.LMS_Account_Owner__c field in checkbox field.Please confirm.

Thanks,
Maharajan.C
Tim Coates 6Tim Coates 6
Thanks for your response Maharajan. Account.LMS_Account_Owner__c is a Lookup(User) field. Regards, Tim Coates Get Outlook for iOS
Maharajan CMaharajan C
So what is the return type of your Formula Field.
Tim Coates 6Tim Coates 6
Return type is Text
Maharajan CMaharajan C
So i think you want the user name in the formula right? If yes use the below one otherwise let me know.

Use the Insert Field Option to insert the fields in formula.

IF(
OR(
INCLUDES(Products_of_interest__c, "Learning Management System (LMS)"),
INCLUDES(Products_of_interest__c, "Schoology LMS")), 
Account.LMS_Account_Owner__r.FirstName + " " + Account.LMS_Account_Owner__r.LastName 
,'')


Thanks,
Maharajan.C
Tim Coates 6Tim Coates 6
Thanks Maharajan. That works. Appreciate the help. Regards, Tim Coates Integration Specialist E: tim.coates@powerschool.com C: (916) 768-0405 P: (512) 221-0764 [signature_1834059464] 150 Parkshore Dr., Folsom, CA 95630