I've to check whether the WhoId
value is Contact or Lead. If I convert WhoId
to text then I can check if by standard object prefix like '003' for Contact. So is there any possible way to convert WhoId
to Text in formula fields?
I tried with the formula:
IF( BEGINS(TEXT(WhoID), 003),'Contact','Lead' )
which produces the error:
Incorrect parameter type for function 'TEXT()'. Expected Number, Date, DateTime, Picklist, received Lookup(Contact,Lead)
Best Answer
Use
WhoId
rather thanWho.Id
. Don't wrap it in theTEXT
function either. The value is an Id which behaves as text already. This formula passes a syntax check just fine:Please note if you are trying to access this data via SOQL, you do not even need a formula. You can query or filter on
Who.Type
.