{"id":4467,"date":"2023-02-08T11:48:14","date_gmt":"2023-02-08T11:48:14","guid":{"rendered":"https:\/\/himbap.com\/blog\/?p=4467"},"modified":"2023-02-08T11:48:14","modified_gmt":"2023-02-08T11:48:14","slug":"overcome-multicurrencyplugin-issue-d365","status":"publish","type":"post","link":"https:\/\/himbap.com\/blog\/?p=4467","title":{"rendered":"Overcome MultiCurrencyPlugin Issue D365"},"content":{"rendered":"<p><strong>Problem<\/strong><br \/>\nThe currency of the record does not match the currency of the price list.<\/p>\n<p><strong>Details<\/strong><br \/>\nWe have some custom workflow process which generates sales order which create sales order from customer asset. We suddenly started getting issue in sales order creation. When I started troubleshooting I found this error is generated by <strong>MultiCurrencyPlugin<\/strong><br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2023\/02\/currencyerror.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-4468 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2023\/02\/currencyerror-300x139.png\" alt=\"currencyerror\" width=\"300\" height=\"139\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2023\/02\/currencyerror-300x139.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2023\/02\/currencyerror-624x289.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2023\/02\/currencyerror.png 1011w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>While troubleshooting I checked all the released records currency was matching with the pricelist used to create sales order and it was working fine and no changes is done in the system. While doing further troubleshooting I found somehow it was using currency of the user to create order and currency of the user was different then the currency in the pricelist.<\/p>\n<p>So to resolve this issue while setting pricelist, I setup currency in the sales order like below and it started working<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\r\n salesorder[&quot;pricelevelid&quot;] = billingaccount.GetAttributeValue&lt;EntityReference&gt;(&quot;defaultpricelevelid&quot;).Id);\r\n salesorder[&quot;transactioncurrencyid&quot;] = billingaccount.GetAttributeValue&lt;EntityReference&gt;(&quot;transactioncurrencyid&quot;);\r\n<\/pre>\n<p>So while creating sales entities records make sure you are setting currency otherwise you may face this issue.<\/p>\n<p><strong>Summary<\/strong><br \/>\nThis is how we can fix MultiCurrencyPlugin issue.<\/p>\n<p>Hope it will help someone !!<br \/>\n<strong>Keep learning and Keep Sharing !!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem The currency of the record does not match the currency of the price list. Details We have some custom workflow process which generates sales order which create sales order from customer asset. We suddenly started getting issue in sales order creation. When I started troubleshooting I found this error is generated by MultiCurrencyPlugin While troubleshooting I checked all the&#8230; <a href=\"https:\/\/himbap.com\/blog\/?p=4467\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":4468,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[402,522],"tags":[1028,1026,1030,1029,1027],"_links":{"self":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4467"}],"collection":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4467"}],"version-history":[{"count":2,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4467\/revisions"}],"predecessor-version":[{"id":4470,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4467\/revisions\/4470"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/4468"}],"wp:attachment":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}