Archive for May 2009

I am proud to announce the first book of commerce server. I have contributed nearly 20% of the content (4 key advance chapters). I personally thank Glen smith for giving me an opportunity to work on key & advance chapters like

  • Developing with the Inventory System
  • Developing with the Orders System
  • Developing with the Profile System
  • Developing with the Marketing System (few sections)

If you willing to buy this book, you have couple of options.

Option 1. Through online:
www.software-smith.com/csbook

Option 2. The book is also available from a number of other online bookstores. The ISBN number is 3-8370-3856-4.

Here are some of the links you can refer to before buying this book.

Acknowledgements
Table of Contents
Sample Chapter
Code Samples

clip_image001

If you have any questions and suggestions, do feel free to contact me at kanth(at)ravikanth(dot)net

Related Articles


If you like this post, please click on our sponsor advertisement.


Note: Before you proceed with this article, you can refer to the below article which explains how to make multiple discounts work for a given order.

http://microsoftblog.co.in/commerceserver/how-to-make-multiple-discounts-work/

If you open and see discount interaction properties, you can able to find four checkboxes.

CS discount properties

  1. Condition items of this discount can be reused as condition items for other discounts.
  2. Condition items of this discount can be reused as award for other discounts.
  3. Award items of this discount can be reused as condition items for other discounts.
  4. Award items of this discount can be reused as award items for other discounts.

What is condition item? and what is award item? Let’s discuss this with an example. There are three discounts created –

  • Discount 1 says buy 1 HTC mobile, get 1 GB Memory stick free
  • Discount 2 says buy a LG LCD TV, get HTC mobile file.
  • Discount 3 says buy HTC mobile, get Airtel Prepaid card free.
  • Discount 4 says buy Nokia mobile, get Airtel Prepaid card free.

Condition is the item where you are applying the discount and award item is the item where you are getting free. In our example, for discount 1, condition item is HTC mobile and award item is

So, what happens when you play with these checkboxes.

  • If your basket has four items (say 2 HTC mobiles, one airtel prepaid connection and 1 GB memory stick) and in the marketing manager discount 3 takes priority than discount 1. If the first check box is not checked for discount 1 then you are entitled to get Airtel prepaid connection only and you have to pay money for other three products but if the check box is checked then both discounts are applied and you will get 1 GB memory stick with Airtel prepaid connection.
  • If your basket has three items (one LCD TV, 1 HTC mobile and 1 GB memory stick) and in the marketing manager discount 2 takes priority than discount 1. If the second check box is not checked for discount 1 then you are entitled to get free HTC mobile only and if the checkbox is checked then you can able to get two products – i.e., HTC mobile phone, 1 GB memory stick for free by paying to only LCD TV.
  • Third check box behavior works similar as check box 2 but in reverse way. If your basket is having LCD TV, two HTC mobile & memory stick and If the third check box is not checked for discount 2 and  discount 1 takes priority on discount 2 then the user is entitled to get only memory stick free but if the check box is checked then he will get free HTC mobile and 1 GB free.
  • Fourth check box behavior works similar as first check box but in reverse way. If the user has added one Nokia phone and one HTC mobile then he is entitled to get one Airtel prepaid connection free (Discount 4 takes priority on discount 3). If the fourth check box is checked for discount 3 then he has entitled to get two Airtel Prepaid connections free.

Hope this has given fair knowledge on discount interactions. So what are you waiting for, go ahead and test multiple business scenario using discount interactions.

Related Articles


If you like this post, please click on our sponsor advertisement.


Commerce server Foundation is newly introduced in CS2009. I got excited after seeing the advantages we get with CS foundation (Sep or Oct 2008). The only option I got is to go through MSDN and it is so vast and there is no structure, how & where to start? I tried to learn by going through topics sequentially but lost in many places (especially in relations and relationships).

After couple of weeks, what I found is that I am trying to swim the ocean without swimming in the pond. I don’t know .NET Entity framework and Commerce server foundation is an entity framework. I decided to learn .NET entity framework before learning CS foundation. I had gone through couple of ebooks (in books24x7 – only basics – first few chapters), like “Entity Framework Tutorial – Joydip Kanjilal” and able to understand the concepts of the framework. It became too easy for me when I tried to map the concepts back to CS foundation and I felt Microsoft has provided vast information on CS 2009 features in MSDN .

My Point of view: Learn the concepts and try to map them back to new features in CS foundation and definitely you can able to understand the things mentioned in MSDN. I also feel, Microsoft should have given such references to learn before jumping into CS foundation.

Related Articles


If you like this post, please click on our sponsor advertisement.


The code runs fine if you try to create catalog using commerce server runtime.

CatalogContext catalogContext =
CommerceContext.Current.CatalogSystem;

BaseCatalog baseCatalog =
catalogContext.CreateBaseCatalog("Books", "productId", string.Empty, "en-us", "en-us");

You can able to see the newly created catalog in the catalog manager but when you try to expand it then you will receive following error.

image

It looks wired as I don’t have any issues in accessing the newly created catalog through runtime and only faces this issue when try to accesses through catalog manager.

When I observed event log, I saw following error.

Microsoft.CommerceServer.ServerFaultException: Failed to retrieve the AzMan Scope named CatalogScope_Books. —> System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Failed to retrieve the AzMan Scope named CatalogScope_Books. —> Microsoft.CommerceServer.ServerFaultException: Failed to retrieve the AzMan Scope named CatalogScope_Books.
   — End of inner exception stack trace —
   at Microsoft.CommerceServer.Catalog.Internal.WebServiceUtility. PropagateOrLogException(Exception except)
   at Microsoft.CommerceServer.Catalog.WebService.CatalogWebService. PropagateOrLogException(Exception except)
   at Microsoft.CommerceServer.Catalog.Internal.CatalogServerContextBase. GetCategory(String catalogName, String categoryName, String language, CategoryConfiguration config, Boolean getFromCache, Nullable`1 isVirtualCatalog, Nullable`1 validateLanguage)
   at Microsoft.CommerceServer.Catalog.Internal.CatalogServerContextBase. GetCategory(String catalogName, String categoryName, String language, CategoryConfiguration config)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Microsoft.CommerceServer.Catalog.WebService.Proxies.CatalogWebService. AuthorizedInvoke(String methodName, Object[] parameters)
   — End of inner exception stack trace —

This error is due to authorization. While creating catalog through business tools, catalog manger takes care of writing entries into catalog authorization store but if we are creating using runtime API then we have to create entries manually into authorization store.

Follow below steps to fix this problem.

  • Open CatalogAuthorizationStore.xml file in Authorization manager.
  • Right click on “CatalogandInventorySystem” and select “New Scope”.
  • Give scope name as “CatalogScope_CatalogName” – In our context it’s “CatalogScope_Books”.
  • Right click on "Task Definitions" and click on "New Task Definition". Click "Add" button and select appropriate tasks & operations.
  • Right click on "Role Defintions" and click on "New Role Definiton". Click "Add" button and select appropriate roles.
  • Right click on "Role Assignments" and click on "New Role Assignment". Select appropriate roles and press OK button.
  • Make sure you add your windows id to the role.

Once the above tasks got completed. You can able to access the catalog through catalog manager.

Note: You have follow similar process whenever you create Inventory Catalog or a Property.

Related Articles


If you like this post, please click on our sponsor advertisement.


I saw a post in commerce communities asking how to use XML data types in commerce server order system. Commerce server (CS) does have some constraints on data types. Since CS is working with SQL Server, we should not assume that it supports all the data types supported by SQL server. Click below links to know more about the supported .NET and SQL Server data types.

http://msdn.microsoft.com/en-us/library/aa545934.aspx

http://msdn.microsoft.com/en-us/library/dd464501.aspx

If your question is “I have to use XML Data type” and the straight forward answer is “No”. I have small work around for this problem – and it may or may not work for you.

  • Create two columns in database
  • column1 of type nvarchar(max)
  • column2 of type xml
  • Extend order system as explained in MSDN site add map the XML to the column 1 (assuming that you are storing serialized object data in column 1).
  • Write a database trigger to update Column 2 when Column 1 changes.
  • At a given point of time, data in both columns will be same. Whenever you want to use XML Search feature then you can use column 2 and whenever you want to work on XML data through C# then you can get serialized data from column1, desterilize back and manipulate the object.

    Related Articles


    If you like this post, please click on our sponsor advertisement.


    Follow me on Google+
    Add to circles

    In 0 people's circles

    Sign up for Newsletter