是否可以在 fetchxml 中将字段从标识符转换为字符串?
我有这样的疑问:
select *
from table1 t1 left outer join table2 t2
on t1.stringId=CAST( t2.id as varchar(40))
where t2.id is null and t1.childid is not null
和这一行t1.stringId=CAST( t2.id as varchar(40))
当字段“stringId”是字符串但它的值是 GUID 时,无法在 fetchxml 中创建
我希望拥有这种平等。
在 fetchxml 中:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" >
<entity name="table1 " >
<attribute name="stringid" />
<attribute name="te_name" />
<link-entity name="table1" from="id" to="stringid" link-type="outer" alias="s" />
<filter type="and" >
<condition entityname="s" attribute="stringid" operator="null" />
</filter>
</entity>
</fetch>
我不知道我是否遗漏了一些东西,但 Dynamics CRM/365 在连接类型方面相当宽容。
将字符串字段连接到 guid 字段是很有可能的。
请参阅此示例,其中我在联系人的传真属性中放置了帐户的 guid:
<fetch version='1.0' output-format='xml-platform' mapping='logical' >
<entity name='contact' >
<attribute name='fullname' />
<attribute name='fax' />
<attribute name='parentcustomerid' />
<filter type='and' >
<condition attribute='statecode' operator='eq' value='0' />
</filter>
<attribute name='contactid' />
<link-entity name='account' from='accountid' to='fax' link-type='outer' >
<attribute name='name' />
</link-entity>
</entity>
</fetch>
所以是的,你是正确的,强制转换是不可能的,但是你的示例中的查询仍然可以很好地执行,我想这就是这一切的目标。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)