When I left join to the phonecall entity, the [from] and [to] fields of this entity don't show the data contained there (but with an inner join they do).
The following script creates test records and illustrates the hidden left join from and to values...
declare @oppname as varchar(50)
select @oppname = GETDATE()
select @oppname = 'richSqlTest '+ @oppname
select '1. new test opportunity name = ', @oppname
insert into opportunity (name) select @oppname
select '2. made a new test opportunity'
declare @oppid as varchar(50)
select top 1 @oppid = opportunityid from opportunity where name = @oppname order by createdon desc
select '3. the new opp has this ID:', @oppid
insert into phonecall ([from],[to], subject, regardingobjectid, regardingobjectidtype)
select top 1 u.systemuserid, c.contactid, 'A test phonecall', @oppid, 'opportunity' from systemuser u, contact c
SELECT '4. made a new phonecall for that opp:', activityid [from],[to], subject, regardingobjectid, regardingobjectidtype FROM phonecall where regardingobjectid = @oppid
SELECT '5. inner join displays the from and to values', o.name, o.opportunityid, p.activityid, p.[from], p.[to]
FROM opportunity o
join phonecall p ON o.opportunityid = p.regardingobjectid
where o.opportunityid = @oppid
SELECT '6. LEFT join hides from and to values', o.name, o.opportunityid, p.activityid, p.[from], p.[to]
FROM opportunity o
LEFT join phonecall p ON o.opportunityid = p.regardingobjectid
where o.opportunityid = @oppid
Environment
- SQL 4 CDS edition: XrmToolBox
@@VERSION = Microsoft Dataverse - 9.2.26013.147
SQL 4 CDS - 10.1.1.0
Dec 10 2025 08:59:29
Copyright © 2020 - 2025 Mark Carrington
When I left join to the phonecall entity, the [from] and [to] fields of this entity don't show the data contained there (but with an inner join they do).
The following script creates test records and illustrates the hidden left join from and to values...
Environment
@@VERSION= Microsoft Dataverse - 9.2.26013.147SQL 4 CDS - 10.1.1.0
Dec 10 2025 08:59:29
Copyright © 2020 - 2025 Mark Carrington