第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

在單個(gè)查詢中檢索所有記錄

在單個(gè)查詢中檢索所有記錄

C#
梵蒂岡之花 2022-11-21 16:24:40
我創(chuàng)建了 (1) 2 個(gè)帳戶(第一個(gè)將成為第二個(gè)帳戶的父級(jí))(2) 創(chuàng)建了 2 個(gè)聯(lián)系人(關(guān)聯(lián)第一個(gè)聯(lián)系人將是第一個(gè)帳戶,第二個(gè)聯(lián)系人將是第二個(gè)帳戶)(3) 創(chuàng)建了一個(gè)筆記并將其與父級(jí)關(guān)聯(lián)帳戶 (4) 創(chuàng)建了兩個(gè)注釋并將其與第二個(gè)聯(lián)系人相關(guān)聯(lián)現(xiàn)在我想在單個(gè)查詢中檢索所有記錄..我試過(guò)但沒(méi)有得到結(jié)果..var fetch = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>" +                  "<entity name='account'>" +                    "<attribute name='name' />" +                    "<attribute name='primarycontactid' />" +                    "<attribute name='telephone1' />" +                    "<attribute name='accountid' />" +                    "<order attribute='name' descending='false' />" +                    "<link-entity name='contact' from='parentcustomerid' to='accountid' link-type='inner' alias='bd'>" +                    "<attribute name='fullname' />" +                      "<link-entity name='annotation' from='objectid' to='contactid' link-type='inner' alias='be'>" +                        "<filter type='and'>" +                          "<condition attribute='subject' operator='not-null' />" +                        "</filter>" +                      "</link-entity>" +                    "</link-entity>" +                  "</entity>" +                "</fetch>"; EntityCollection Coll = CrmConn.RetrieveMultiple(new FetchExpression(fetch));                foreach (Entity acunt in Coll.Entities)                {                    Console.WriteLine("Name of Account: " + acunt.GetAttributeValue<string>("name"));                    Console.WriteLine("Name of Contact: "  +acunt.GetAttributeValue<string>("fullname"));                    Console.WriteLine("Name of Notes: " + acunt.GetAttributeValue<string>("subject"));                    //Console.WriteLine("contact: ", Coll.Entities[]);                 }它只顯示帳戶名不顯示注釋和聯(lián)系人
查看完整描述

1 回答

?
至尊寶的傳說(shuō)

TA貢獻(xiàn)1789條經(jīng)驗(yàn) 獲得超10個(gè)贊

確定使用以下查詢僅檢索客戶及其相關(guān)聯(lián)系人。我可以檢索帳戶及其相關(guān)聯(lián)系人?,F(xiàn)在獲取這些帳戶及其 ID,并使用第二個(gè)查詢來(lái)獲取 Notes(注釋),您將為 Notes 做同樣的事情。


<fetch>

  <entity name="account" >

    <attribute name="name" />

    <link-entity name="contact" from="parentcustomerid" to="accountid" link-type="inner" >

      <attribute name="fullname" />

    </link-entity>

  </entity>

</fetch>

檢索筆記的查詢:


<fetch>

  <entity name="annotation" >

    <attribute name="filename" />

    <attribute name="documentbody" />

    <attribute name="isdocument" />

    <link-entity name="account" from="accountid" to="objectid" link-type="inner" >

      <filter type="and" >

        <condition attribute="accountid" operator="eq" value="AccountGuid" />

      </filter>

    </link-entity>

  </entity>

</fetch>

C# 代碼示例


string fetch = @"  

   <fetch>

  <entity name='account' >

    <attribute name='name' />

    <link-entity name='contact' from='parentcustomerid' to='accountid' link-type='inner' alias='Contact' >

      <attribute name='fullname' alias = 'Contact.Fullname' />

    </link-entity>

  </entity>

</fetch> ";


           EntityCollection Coll = CrmConn.RetrieveMultiple(new FetchExpression(fetch));


                foreach (Entity acunt in Coll.Entities)

                {

                    Console.WriteLine("Name of Account: " + acunt.GetAttributeValue<string>("name"));

                    Console.WriteLine("Name of Contact: "  + acunt.GetAttributeValue<AliasedValue>("Contact.Fullname").Value);

                 }


查看完整回答
反對(duì) 回復(fù) 2022-11-21
  • 1 回答
  • 0 關(guān)注
  • 99 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)