{"id":43,"date":"2020-05-12T21:55:40","date_gmt":"2020-05-12T13:55:40","guid":{"rendered":"https:\/\/just-a-web.com\/blog\/?p=43"},"modified":"2020-11-03T21:59:48","modified_gmt":"2020-11-03T13:59:48","slug":"fetch-xml-filter-on-link-entity","status":"publish","type":"post","link":"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/","title":{"rendered":"Fetch XML &#8211; Filter On Link Entity"},"content":{"rendered":"\n<p>Recently when I am working on a search core functionality, there is a challenge where I have made link-entity but need to do filtering.<\/p>\n\n\n\n<p>There is an error when calling the API stating that 2 filter nodes is not allowed.<\/p>\n\n\n\n<p>End up, I have used to put all the link-entity filter attributes into the main filter criteria.<\/p>\n\n\n\n<p>Eg. Retrieve Contact that link to account, both contact and account have to do some filter criteria.<\/p>\n\n\n\n<p>In the Fetch XML, simply put as below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"xml\" class=\"language-xml line-numbers\">&lt;condition entityname=\"account\" attribute=\"name\" operator=\"like\" value=\"%test%\"><\/code><\/pre>\n\n\n\n<p>With the entityname being stated, which mean it will filter for the link-entity &#8211; account instead of the main entity &#8211; contact.<\/p>\n\n\n\n<p>Hope it helps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently when I am working on a search core functionality, there is a challenge where I have made link-entity but need to do filtering. There is an error when calling the API stating that 2 filter nodes is not allowed. End up, I have used to put all the link-entity filter attributes into the main&hellip;&nbsp;<a href=\"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Fetch XML &#8211; Filter On Link Entity<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[1],"tags":[23,24],"class_list":["post-43","post","type-post","status-publish","format-standard","hentry","category-dynamics","tag-fetchxml","tag-link-entity"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.3.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Fetch XML - Filter On Link Entity - Dynamics Blog<\/title>\n<meta name=\"description\" content=\"Filter link entity in Fetch XML when hit errors.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fetch XML - Filter On Link Entity - Dynamics Blog\" \/>\n<meta property=\"og:description\" content=\"Filter link entity in Fetch XML when hit errors.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/\" \/>\n<meta property=\"og:site_name\" content=\"Dynamics Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-12T13:55:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-03T13:59:48+00:00\" \/>\n<meta name=\"author\" content=\"hk.ang\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"hk.ang\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/\"},\"author\":{\"name\":\"hk.ang\",\"@id\":\"https:\/\/just-a-web.com\/blog\/#\/schema\/person\/7c5fde715b55adf97070f3506709b0af\"},\"headline\":\"Fetch XML &#8211; Filter On Link Entity\",\"datePublished\":\"2020-05-12T13:55:40+00:00\",\"dateModified\":\"2020-11-03T13:59:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/\"},\"wordCount\":113,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/just-a-web.com\/blog\/#\/schema\/person\/7c5fde715b55adf97070f3506709b0af\"},\"keywords\":[\"fetchxml\",\"link-entity\"],\"articleSection\":[\"Dynamics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/\",\"url\":\"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/\",\"name\":\"Fetch XML - Filter On Link Entity - Dynamics Blog\",\"isPartOf\":{\"@id\":\"https:\/\/just-a-web.com\/blog\/#website\"},\"datePublished\":\"2020-05-12T13:55:40+00:00\",\"dateModified\":\"2020-11-03T13:59:48+00:00\",\"description\":\"Filter link entity in Fetch XML when hit errors.\",\"breadcrumb\":{\"@id\":\"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/just-a-web.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fetch XML &#8211; Filter On Link Entity\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/just-a-web.com\/blog\/#website\",\"url\":\"https:\/\/just-a-web.com\/blog\/\",\"name\":\"Dynamics Blog\",\"description\":\"A blog that related to coding stuff\",\"publisher\":{\"@id\":\"https:\/\/just-a-web.com\/blog\/#\/schema\/person\/7c5fde715b55adf97070f3506709b0af\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/just-a-web.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/just-a-web.com\/blog\/#\/schema\/person\/7c5fde715b55adf97070f3506709b0af\",\"name\":\"hk.ang\",\"logo\":{\"@id\":\"https:\/\/just-a-web.com\/blog\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/just-a-web.com\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Fetch XML - Filter On Link Entity - Dynamics Blog","description":"Filter link entity in Fetch XML when hit errors.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/","og_locale":"en_US","og_type":"article","og_title":"Fetch XML - Filter On Link Entity - Dynamics Blog","og_description":"Filter link entity in Fetch XML when hit errors.","og_url":"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/","og_site_name":"Dynamics Blog","article_published_time":"2020-05-12T13:55:40+00:00","article_modified_time":"2020-11-03T13:59:48+00:00","author":"hk.ang","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hk.ang","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/#article","isPartOf":{"@id":"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/"},"author":{"name":"hk.ang","@id":"https:\/\/just-a-web.com\/blog\/#\/schema\/person\/7c5fde715b55adf97070f3506709b0af"},"headline":"Fetch XML &#8211; Filter On Link Entity","datePublished":"2020-05-12T13:55:40+00:00","dateModified":"2020-11-03T13:59:48+00:00","mainEntityOfPage":{"@id":"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/"},"wordCount":113,"commentCount":0,"publisher":{"@id":"https:\/\/just-a-web.com\/blog\/#\/schema\/person\/7c5fde715b55adf97070f3506709b0af"},"keywords":["fetchxml","link-entity"],"articleSection":["Dynamics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/","url":"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/","name":"Fetch XML - Filter On Link Entity - Dynamics Blog","isPartOf":{"@id":"https:\/\/just-a-web.com\/blog\/#website"},"datePublished":"2020-05-12T13:55:40+00:00","dateModified":"2020-11-03T13:59:48+00:00","description":"Filter link entity in Fetch XML when hit errors.","breadcrumb":{"@id":"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/just-a-web.com\/blog\/2020\/05\/12\/fetch-xml-filter-on-link-entity\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/just-a-web.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Fetch XML &#8211; Filter On Link Entity"}]},{"@type":"WebSite","@id":"https:\/\/just-a-web.com\/blog\/#website","url":"https:\/\/just-a-web.com\/blog\/","name":"Dynamics Blog","description":"A blog that related to coding stuff","publisher":{"@id":"https:\/\/just-a-web.com\/blog\/#\/schema\/person\/7c5fde715b55adf97070f3506709b0af"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/just-a-web.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/just-a-web.com\/blog\/#\/schema\/person\/7c5fde715b55adf97070f3506709b0af","name":"hk.ang","logo":{"@id":"https:\/\/just-a-web.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/just-a-web.com\/blog"]}]}},"_links":{"self":[{"href":"https:\/\/just-a-web.com\/blog\/wp-json\/wp\/v2\/posts\/43","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/just-a-web.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/just-a-web.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/just-a-web.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/just-a-web.com\/blog\/wp-json\/wp\/v2\/comments?post=43"}],"version-history":[{"count":1,"href":"https:\/\/just-a-web.com\/blog\/wp-json\/wp\/v2\/posts\/43\/revisions"}],"predecessor-version":[{"id":44,"href":"https:\/\/just-a-web.com\/blog\/wp-json\/wp\/v2\/posts\/43\/revisions\/44"}],"wp:attachment":[{"href":"https:\/\/just-a-web.com\/blog\/wp-json\/wp\/v2\/media?parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/just-a-web.com\/blog\/wp-json\/wp\/v2\/categories?post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/just-a-web.com\/blog\/wp-json\/wp\/v2\/tags?post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}