Salesforce Fact #835 | Multiple TYPEOF in SOQL query

We can have multiple TYPEOF clause in SOQL query.

Example:

SELECT

    TYPEOF What

        WHEN Account THEN Phone

        ELSE Name

    END,

    TYPEOF Who

        WHEN Contact THEN Email

        ELSE Phone

    END 

FROM Task

Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

Salesforce Fact #457 | Get current user role name in flow