in my custom Activities report type, I need to show which object the activitiy is related to, e.g. lead, account. Contact or lead activities have an ID in the field WhoId, account, opportunities and shipment (custom object) activities have the WhatID filled in.
I am trying to create a formula field on activities that would check the three first ID characters of WhoId, or if this one is empty the WhatId and return a defined value.
My formula keeps on returning the syntax error "Missing ')'" which I'm sure is not a problem. The issue must be probably with the CASE or the ISBLANK functions that were wrongly used. I keep on rebuilding the whole formula but it didn't work so far:
IF(ISBLANK(WhatId),
(CASE(LEFT(WhoId,3),"003","Contact",
"00Q","Lead"),
(CASE(LEFT(WhatId,3),"001","Account",
"006","Opportunity",
"0YP","Shipment"),
"Other")
)
)
I would be grateful for any suggestions.