{"id":155,"date":"2018-01-20T20:27:12","date_gmt":"2018-01-20T19:27:12","guid":{"rendered":"http:\/\/pro.timphaus.de\/?p=155"},"modified":"2019-04-19T12:41:48","modified_gmt":"2019-04-19T11:41:48","slug":"find-d365fo-customer-from-contact-mail","status":"publish","type":"post","link":"https:\/\/dynamiacs.com\/?p=155","title":{"rendered":"Find D365FO customer from contact mail"},"content":{"rendered":"\n<p>How to find a customer in Dynamics 365 for Finance and Operations only for example by the&nbsp;&nbsp;email address of an incoming email.<\/p>\n\n\n\n<p>With flow and the action &#8220;get records&#8221; it is very easy.<\/p>\n\n\n\n<p>The first step after for example a trigger like &#8220;When an email arrives&#8221; is an action called &#8220;Get Records&#8221;. Please be aware to select the connector to Dynamics 365 for&nbsp;&nbsp;Finance and Operations because the following describes only the steps for this connector.<\/p>\n\n\n\n<p>After adding the action you have to select the instance in which your contacts and customers are maintained.<\/p>\n\n\n\n<p>In the entity name field select the entity &#8220;ContactPersons&#8221; because we need to find the right contact to the email address.<\/p>\n\n\n\n<p>To get this work the filter has to be defined in the field Filter Query.<\/p>\n\n\n\n<p>There we have to enter the field of the D365FO Entity where the email addresses are inserted. This field is called &#8220;PrimaryEmailAddress. To get the correct contact we have to enter:<\/p>\n\n\n\n<p>PrimaryEmailAddress eq &#8216;<em>emailaddress<\/em>&#8216;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>eq stands for equal<\/li><li>Emailaddress can be a fixed entry or can be for example the From field from the trigger &#8220;When an email arrives&#8221;.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"501\" src=\"http:\/\/pro.timphaus.de\/wp-content\/uploads\/2019\/02\/d365fo_find_customer_00-1.png\" alt=\"\" class=\"wp-image-158\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/02\/d365fo_find_customer_00-1.png 900w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/02\/d365fo_find_customer_00-1-300x167.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/02\/d365fo_find_customer_00-1-768x428.png 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/figure>\n\n\n\n<p>Now we have as a result the correct contact but not the customer. To find the customer we a second action. This is the same action type as above.<\/p>\n\n\n\n<p>When we insert the action as the second step we get an apply to each because theoretical it is possible that we get more than 1 results from the first step.<\/p>\n\n\n\n<p>In the instance field we have to select the same instance we have selected in the first step.<\/p>\n\n\n\n<p>Now we need another Entity Name as in step 1. Here we need the Entity Customers.<\/p>\n\n\n\n<p>To find the right customer we will use the field associated party number from the ContactPersons entity to compare with the PartyNumber field from the entity Customers.<\/p>\n\n\n\n<p>See the screenshots in the field Filter Query the needed phrase.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"792\" height=\"590\" src=\"http:\/\/pro.timphaus.de\/wp-content\/uploads\/2019\/02\/d365fo_find_customer_01.png\" alt=\"\" class=\"wp-image-157\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/02\/d365fo_find_customer_01.png 792w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/02\/d365fo_find_customer_01-300x223.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/02\/d365fo_find_customer_01-768x572.png 768w\" sizes=\"auto, (max-width: 792px) 100vw, 792px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>How to find a customer in Dynamics 365 for Finance and Operations only for example by the&nbsp;&nbsp;email address of an incoming email. With flow and the action &#8220;get records&#8221; it is very easy. The first step after for example a trigger like &#8220;When an email arrives&#8221; is an action called &#8220;Get Records&#8221;. Please be aware&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[8],"tags":[11],"class_list":["post-155","post","type-post","status-publish","format-standard","hentry","category-blog","tag-dynamics-365"],"taxonomy_info":{"category":[{"value":8,"label":"Blog"}],"post_tag":[{"value":11,"label":"Dynamics 365"}]},"featured_image_src_large":false,"author_info":{"display_name":"Jan","author_link":"https:\/\/dynamiacs.com\/?author=2"},"comment_info":0,"category_info":[{"term_id":8,"name":"Blog","slug":"blog","term_group":0,"term_taxonomy_id":8,"taxonomy":"category","description":"","parent":0,"count":38,"filter":"raw","cat_ID":8,"category_count":38,"category_description":"","cat_name":"Blog","category_nicename":"blog","category_parent":0}],"tag_info":[{"term_id":11,"name":"Dynamics 365","slug":"dynamics-365","term_group":0,"term_taxonomy_id":11,"taxonomy":"post_tag","description":"","parent":0,"count":14,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/posts\/155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=155"}],"version-history":[{"count":1,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/posts\/155\/revisions"}],"predecessor-version":[{"id":159,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/posts\/155\/revisions\/159"}],"wp:attachment":[{"href":"https:\/\/dynamiacs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}