簡體   English   中英

fetchXml CRM中的if-else子句

[英]If-else clause in fetchXml CRM

我想從兩個表的交易和詳細信息中獲取數據。 我可以進行聯接和獲取數據,但是我不知道如何在條件下鏈接實體。 簡單來說,我要

if deal.sell is yes:
    fetch details
else:
    fetch deal

下面的xml鏈接並獲取了details的一些屬性,如何在其中插入if else子句?(如果可能)

<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>
  <entity name='deal'>
    <attribute name='createdon' />
    <attribute name='statecode' />
    <attribute name='dealsid' />
    <link-entity name='details' from='detailsid' to='deal_detail' >
       <attribute name='description' />
    </link-entity>
  </entity>
</fetch>

使用FetchXml無法做到這一點。 您將不得不考慮實現需求的其他方式。

您可以通過多個連接來處理此問題,每個if / else一個連接

使用Pesduo代碼:

 From deal
 Outer Join Details on Deal.Id = Details.Id
 Outer Join Deal on Deal.Id = Deal.ParentDealId

然后,您需要在客戶端上進行工作,以了解您需要什么,不需要什么。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM