{"id":178,"date":"2018-01-17T17:16:31","date_gmt":"2018-01-17T16:16:31","guid":{"rendered":"http:\/\/pro.timphaus.de\/?p=178"},"modified":"2019-04-19T12:42:55","modified_gmt":"2019-04-19T11:42:55","slug":"create-sales-order-with-luis","status":"publish","type":"post","link":"https:\/\/dynamiacs.com\/?p=178","title":{"rendered":"Create Sales Order with LUIS"},"content":{"rendered":"\n<p>I think\nevery company is thinking about how to automate business processes especially\nfor standard process that are there every day in the same needed steps. One of\nthis processes can be the Order Entry process for standard products.<\/p>\n\n\n\n<p>I will\ndescribe in this blog post now Microsoft Flow and&nbsp; LUIS can help here to automate this process.<\/p>\n\n\n\n<p>And the\ncomplete process can take only a few seconds to be completed from incoming\nemail until sending a entry information.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"732\" height=\"990\" src=\"http:\/\/pro.timphaus.de\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_00.png\" alt=\"\" class=\"wp-image-179\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_00.png 732w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_00-222x300.png 222w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/figure>\n\n\n\n<p>The first\nstep is to setup and train LUIS. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"387\" src=\"http:\/\/pro.timphaus.de\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_01-1024x387.png\" alt=\"\" class=\"wp-image-180\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_01-1024x387.png 1024w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_01-300x113.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_01-768x290.png 768w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_01.png 1550w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>I have\nsetup an intent with entity.<\/p>\n\n\n\n<p>If you\nwant to learn more about setup of LUIS please go to luis.ai.<\/p>\n\n\n\n<p>In this\nblog post I will focuss on the things to do in Flow.<\/p>\n\n\n\n<p>After\nsetup is done in LUIS the setup in Microsoft Flow can be done.<\/p>\n\n\n\n<p>There we\nhave to define the trigger which is called &#8220;When a new email\narrives&#8221;.<\/p>\n\n\n\n<p>To get\nonly the emails with subject &#8220;order&#8221; we set the subject filter to\n&#8220;order&#8221;.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"668\" height=\"385\" src=\"http:\/\/pro.timphaus.de\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_02.png\" alt=\"\" class=\"wp-image-181\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_02.png 668w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_02-300x173.png 300w\" sizes=\"auto, (max-width: 668px) 100vw, 668px\" \/><\/figure>\n\n\n\n<p>The next\nstep is to format the body of the email into plain text for better output from\nLUIS.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"667\" height=\"127\" src=\"http:\/\/pro.timphaus.de\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_03.png\" alt=\"\" class=\"wp-image-182\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_03.png 667w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_03-300x57.png 300w\" sizes=\"auto, (max-width: 667px) 100vw, 667px\" \/><\/figure>\n\n\n\n<p>After\nthis a LUIS action is needed to detect the entity &#8220;item&#8221; in the email\nbody.<\/p>\n\n\n\n<p>For this\nwe select the &#8220;get prediction&#8221; action and fill out the needed fields:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>App ID : your App from\n     LUIS.ai<\/li><li>Utterance Text: The plain\n     text from the &#8220;HTML to Text&#8221; action<\/li><li>Desired intent : the intent\n     of the entity we are looking for<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"671\" height=\"198\" src=\"http:\/\/pro.timphaus.de\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_04.png\" alt=\"\" class=\"wp-image-183\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_04.png 671w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_04-300x89.png 300w\" sizes=\"auto, (max-width: 671px) 100vw, 671px\" \/><\/figure>\n\n\n\n<p>After\ndoing this we need the correct customer account in Dynamics 365 for Finance and\nOperations to create the Sales Order. For this we use the &#8220;Get\nRecords&#8221; action.<\/p>\n\n\n\n<p>Knowing\nthat in our setup the primarycontactemail is the right field to find the\ncorrect customer.<\/p>\n\n\n\n<p>So we add\nin the Filter Query section the statement to filter the customer accounts using\nthe field PrimaryContactEmail is equal to the incoming emailadress.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"670\" height=\"377\" src=\"http:\/\/pro.timphaus.de\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_05.png\" alt=\"\" class=\"wp-image-184\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_05.png 670w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_05-300x169.png 300w\" sizes=\"auto, (max-width: 670px) 100vw, 670px\" \/><\/figure>\n\n\n\n<p>With this\nrecord a new sales order can be created. Additional to the customer account\nnumber we get the dataarea ID where we have to create the sales order.<\/p>\n\n\n\n<p>These 2\ninformation are used in the next action which is called create a record. To\ncreate a sales order we have to choose the correct environment and the entitly\ncalled salesorderheaders. Using only these 2 information we can create a new\nsales order.<\/p>\n\n\n\n<p>After the\nsales order header is created we need to fill the sales line. For this we use\nagain the action &#8220;Create a Record&#8221; but instead of entity\nSalesorderHeaders we use the entity SalesOrderLines. <\/p>\n\n\n\n<p>To fill\nthe correct SalesOrder we use the same 2 informations (dataAreaId and Customer\nAccount) and additional the Sales Order Number from the Create Sales Order\nHeader action.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"785\" src=\"http:\/\/pro.timphaus.de\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_06.png\" alt=\"\" class=\"wp-image-185\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_06.png 680w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_06-260x300.png 260w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/figure>\n\n\n\n<p>After\ncreating the sales order we want to inform the customer that the order is\nentered and we send him a possible delivery date which we will confirm in a\nlater step. For this we use a office 365 action called Send an e-mail and use\nas the To email Adress the email adress from the incoming order and in the body\nwe add some field from the created sales order.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"615\" height=\"468\" src=\"http:\/\/pro.timphaus.de\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_07.png\" alt=\"\" class=\"wp-image-186\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_07.png 615w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_07-300x228.png 300w\" sizes=\"auto, (max-width: 615px) 100vw, 615px\" \/><\/figure>\n\n\n\n<p>The next\nsteps are done in the ERP system Dynamics 365 for Finance and operations.<\/p>\n\n\n\n<p>Now a\nsales person has to confirm the sales order. For this there is a workspace in\nDynamics 365 for Finance and Operations available:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Sales Order processing and\n     inquiry<\/li><\/ul>\n\n\n\n<p>In this\nworkspace there are 2 options available to find the unconfirmed orders:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The Tile on the left side\n     &#8220;unconfirmed&#8221;<\/li><li>The list &#8220;unconfirmed.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"540\" src=\"http:\/\/pro.timphaus.de\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_08-1024x540.png\" alt=\"\" class=\"wp-image-187\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_08-1024x540.png 1024w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_08-300x158.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_08-768x405.png 768w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2019\/03\/SalesOrderLUIS_08.png 1453w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>This process steps will not be described in this blog post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I think every company is thinking about how to automate business processes especially for standard process that are there every day in the same needed steps. One of this processes can be the Order Entry process for standard products. I will describe in this blog post now Microsoft Flow and&nbsp; LUIS can help here to&#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":[21,11,24],"class_list":["post-178","post","type-post","status-publish","format-standard","hentry","category-blog","tag-cognitive-services","tag-dynamics-365","tag-luis"],"taxonomy_info":{"category":[{"value":8,"label":"Blog"}],"post_tag":[{"value":21,"label":"Cognitive Services"},{"value":11,"label":"Dynamics 365"},{"value":24,"label":"Luis"}]},"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":21,"name":"Cognitive Services","slug":"cognitive-services","term_group":0,"term_taxonomy_id":21,"taxonomy":"post_tag","description":"","parent":0,"count":4,"filter":"raw"},{"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"},{"term_id":24,"name":"Luis","slug":"luis","term_group":0,"term_taxonomy_id":24,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/posts\/178","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=178"}],"version-history":[{"count":1,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/posts\/178\/revisions"}],"predecessor-version":[{"id":188,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/posts\/178\/revisions\/188"}],"wp:attachment":[{"href":"https:\/\/dynamiacs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}