{"id":4151,"date":"2014-03-30T08:29:06","date_gmt":"2014-03-30T08:29:06","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/when-to-use-commerce-query-collection-of-common-programming-errors\/"},"modified":"2014-03-30T08:29:06","modified_gmt":"2014-03-30T08:29:06","slug":"when-to-use-commerce-query-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/when-to-use-commerce-query-collection-of-common-programming-errors\/","title":{"rendered":"When to use commerce query ?-Collection of common programming errors"},"content":{"rendered":"<p>Kumudha.D-<\/p>\n<p>Here&#8217;s the MSDN link for the CommerceQuery object http:\/\/msdn.microsoft.com\/en-us\/library\/dd327963(CS.90).aspx<\/p>\n<p>These objects are the suggested mechanism for working with all the Commerce Server 2009 systems in a runtime scenario[1]- effectively all profile, catalog, marketing, and order information should be retrieved and\/or updated on your site using the CommerceQuery object.<\/p>\n<p>If you&#8217;re developing an ASP.Net application, I would actually recommend that you leverage the Microsoft.Commerce.Portal.Common assembly and work with the various &#8220;Controller&#8221; and &#8220;Utility&#8221; classes in that assembly (CatalogController, CatalogUtility, for example), as these classes already encapsulate the required CommerceQuery objects, and are somewhat more intuitive to work with[2].<\/p>\n<p>The &#8220;OrdersWebService&#8221; that you refer to is intended as an administrative API and uses the objects from CS2007- you cannot use CommerceQuery objects to work with this system- if you&#8217;d like to work with a wrapper for this API, consider using the OrderServiceAgent and OrderManagementContext objects from the CS2007 API stack (http:\/\/msdn.microsoft.com\/en-us\/library\/microsoft.commerceserver.orders.ordermanagementcontext(v=CS.90).aspx\u00a0and http:\/\/msdn.microsoft.com\/en-us\/library\/microsoft.commerceserver.orders.orderserviceagent(CS.90).aspx).\u00a0 It should be noted that these objects are intended for administrative purposes only, and should not be used on a runtime site without very careful design considerations; misuse of these objects can create rather serious security and performance issues down the road.<\/p>\n<p>[1] By runtime, I&#8217;m referring to a public (or semi-public) e-Commerce application which serves a large user-base and is highly available.\u00a0 This should be distinguished from Administraiton scenarios which serve a smaller user base and do not require triple-9 availability.<\/p>\n<p>[2] There are always exceptions to this, but these classes should be flexible enough to handle *most* of your functional requirements.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Kumudha.D- Here&#8217;s the MSDN link for the CommerceQuery object http:\/\/msdn.microsoft.com\/en-us\/library\/dd327963(CS.90).aspx These objects are the suggested mechanism for working with all the Commerce Server 2009 systems in a runtime scenario[1]- effectively all profile, catalog, marketing, and order information should be retrieved and\/or updated on your site using the CommerceQuery object. If you&#8217;re developing an ASP.Net application, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4151","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4151"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4151\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}