Salesforce Fact #488 | Who.Name & What.Name in SOQL

Do you know we can get the Name and Related To field's record name field value on task object using relationship query.

On Task object, Name field is WhoId i.e. Leads/Contacts and Related To is for other supported objects. So, Who.Name and What.Name works perfectly fine.

Example SOQL: 

SELECT Id, WhoId, Who.Name, WhatId, What.Name 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