Salesforce Decode
Salesforcedecode
SOQL & Data ModelingAdvancedConceptualsoqlpolymorphictypeof

How do you query polymorphic fields like WhatId or OwnerId?

Scenario

You need Task records with the related record's name, plus Amount when the related record is an Opportunity.

Answer it out loud first

Serious prep means attempting before reading. Take two minutes to structure your answer, then compare.