Sitecore Notebook

Sitecore Commerce 8.2.1 - installation issues

Have you ever tried to install Sitecore Commerce 8.2.1? Installation process can be a little complicated especially when you install it for the first time. Installation guide is a quite long, so it is very likely that you will have to struggle with some issues during installation. I struggled with some problems during bootstrap process and initialization Commerce Server environment and I give you some tips how to resolve them. 

Bootstrap process

Problems started during bootstrap process. Running command http://localhost:5000/commerceops/Bootstrap() was not successful. I noticed on the screen a lot of errors. The resolution of this problem was quite simple. I had to change SQL server name in whole configuration JSONs files of Commerce Server. In case of any problems with bootstrap  find each appearance of "Server": "." in JSON files located in paths:

- CommerceAuthoring\wwwroot\data\Environments
- CommerceAuthoring\wwwroot\bootstrap 

and change it to your own server name. After that bootstrap command should be completed without errors.  

Initialization the Adventure Works environment 

Next issue that I needed to resolve was error:
Entity Adventure Works Catalog|AW535-11| was not found during initialization the Adventure Works environment with command http://localhost:5000/commerceops/InitializeEnvironment(environment='AdventureWorksShops').  If you have such error message try to open Commerce Server Catalog Manager and check if you have Adventure Works Catalog imported there. If not, import it manually. You will find Catalog.xml to import in path YourWebsite\Website\SitecoreCommerce\Data\Catalog\Catalog.xml. After that before you run initialization command again you need to remove all entries from CommerceEntities and CommerceLists tables in SitecoreCommerce_SharedEnvironments database and restart Commerce Server site in IIS.

Disabled option to import catalog in Commerce Server Catalog Manager

Before resolution of initialization the Adventure Works environment I needed to find out why I can't import any catalog to Commerce Server Catalog Manager. In my case option to import was disabled.

It was problem with IIS sites authentication. Changing CatalogWebService authentication in IIS to Windows Authentication and disabling all other authentication options resolved my problem. If you do not have available Windows Authentication in IIS as a option, you need to enable it in Windows Features.

Initialization the Habitat Authoring environment

The last one issue appeared during execution command: http://localhost:5000/commerceops/InitializeEnvironment(environment='HabitatAuthoring'). I had error: Entity Habitat_Master|7042071| was not found. In my case helped import of those two catalogs to Commerce Server Catalog Manager:

- CommerceAuthoring\wwwroot\data\Catalogs\Habitat_Master.xml

Remember to clean entries in SitecoreCommerce_SharedEnvironments database tables that I mentioned before and restart Commerce Server site in IIS before next initialization of Adventure Works and  Habitat Authoring environments.

I hope that those information will help you a little during whole installation process and save you some time. I keep my fingers crossed for you! Good luck and enjoy Sitecore Commerce functionalities!

First SUG Poland meeting impressions

I had pleasure to participe in first Sitecore User Group Poland meeting. It is newly created group, which connects Sitecore developers from Poland. The first meeting was in Białystok. I would like to give you some short description of this event and share with you my impressions.

The first presentation was about SXA. Robert Dębowski, Sitecore developer and blogger,  prepared good piece of practice knowledge about  this module. In few words SXA allows us to create pages faster than we think that is possible. It was good introduction to go deeper into SXA module usage. Thanks Robert.

Next presentation was prepared by Robert Senktas, Sitecore developer and blogger He was talking about Sitecore Azure Toolkit. He showed us how we can make Azure deployments using Sitecore Azure Toolkit.  Sitecore Azure Toolkit was completely new topic for me, so I'm happy that Robert shared his knowledge with us and I'm waiting for next Roberts presentation.

The last one presentation about SPEAK 2 was showed by Łukasz Skowroński, our Polish Sitecore MVP and blogger Łukasz gave us few valuable advice about creating Sitecore widgets using SPEAK 2. I think that after this presentation every of participants will be able to create first SPEAK 2 widget on their own.

Apart for very interesting presentations, sponsors of SUG Poland meeting prepared us some gifts, some books, some pizza and...

... some beer of course :)
Thank you guys for presentations and thank you Michał Janucik for photos from event!  I can't wait to next SUG Poland meeting to gain valuable knowledge, meet with my friends and have a great time in after party :)


WFFM save action - Client Action checkbox

I noticed interesting issue with WFFM a few months ago and I would like to share with you resolution of this issue. I have prepared some custom save action in Web Forms For Marketers module for Sitecore 8.2. Custom save action had been working as expected in my local Sitecore instance, which was single Sitecore instance not divided to Content Delivery and Content Management instances.

Problems appeared when I moved action to enviroment, in which Content Management and Content Delivery were divided to separate instances. The action was not triggering correctly in Content Delivery environment. After some investigation I have found out that action is still working in Content Management environment and then I found out what caused this issue.

In WFFM save action configuration there is section Submit and inside this section is located checkbox Client Action, which is marked in above screen. After checking this checkbox custom save action started working in CD environment. Without selecting Client Action checkbox action was triggering only in CM environment.

If you have similar issue with your custom save action remember about this checkbox if your custom action is not triggering in CD server, but is working in CM server. It may resolve your issue.

Introduction to workflows

Sitecore CMS has very powerful, out of the box functionality which helps with organize content management. This functionality is called workflow. Correctly configured workflows can improve content versioning and publishing processes. I will try to explain what exactly Sitecore workflow is and how to properly configure it.

First of all, workflow determines process of publishing items. It consists of states, commands and actions. Sitecore item which has assigned some workflow after some edition need to go through workflow states from initial state to final state to be able to be published. Moving item to another workflow state is achieved by using commands. The additional part of workflows are actions. Actions can be used to perform some automatic operations after moving item to next workflow state. I know, it seems complicated, but take a look on the below screen.

I think that the best way of explanation workflows will be explanation based on some simple example. Sitecore workflows are located in sitecore/System/Workflows path. In the screen you can see Basic Workflow. It is simple workflow created for this post purposes. As you can see this workflow consists of three states: Draft, In Approval and Approved.

Draft state is initial state of Basic workflow. It is important, because each workflow has to have defined initial state. Workflow can have only one initial state assigned. How to assign initial state to workflow? Inside Data section in Basic Workflow item there is field called Initial State.

Draft state is workflow state, which is assigned to items which were created or edited by content editors. Such items have to be approved by administrator or some user with privileges to accept changes in content made by content editors before publish. It has one command added as children item. I called it Send for approval. As I said earlier command are used to move items from one workflow state to some other workflow state. How do configure command to move item to other state? In command item properties there is field Next state in Data section. As it is showed in below screen Send for approval command moves item from Draft state to In Approval state.

In Approval state is transitional state between Draft and Approved states. In this state changes made by content editors have to be accepted or rejected by proper user which has access to execute commands from this state. State consists of two commands: Approve and Discard. Discard is configured to move item back to Draft state to allow content editor make some changes in item before it will be again send for approval. Approve is configured to change item state to Approved.

If item is moved to Approved workflow state it means that content is well prepared and it is ready to publish it. This state is configured as Final workflow state.

Workflow can have multiple final states. In this case Basic Workflow has only one Approved state configured as final. It is required to have at least one final state in workflow, because items in states other than final are not publishable. When item moves to workflow state marked as final it is publishable again.

Approved state has added as children item action called Publish. Actions allow to perform some operations automatically after move to some state or after execute some command. In this case I prepared some simple action which automatically publish item after moving from In Approval state to Approved state. Action is configured to use default Sitecore PublishAction as you can see in below screen in Type string field. To this publishing action can be passed some additional parameters to configure publishing process. In case of Basic Workflow I passed deep=1 parameter, which means that all children of published item should be published with this item. If you need some additional information about PublishAction parameters visit:

That's ok, but how to assign workflow to specific item? Recommended way to assign workflow to some group of items is set Default Workflow field in Workflow section of template item __Standard Values. Then all items created from this template will have already assigned workflow specified in Default Workflow field.

There are some additional things which should be mentioned if we talk about workflows. Items in final state during next edition by user other than administrator are moved automatically to initial state (in case of Basic Workflow - to Draft state) and item has to go through all workflow approval process from the beginning to be publishable again.  The next important thing is that during each edition of item in final state by non admin user next version of item is created automatically.

I hope that after reading this post you are more familiar with Sitecore workflows and how it can help with content management process and item versioning process. Example of workflow in this post is very simple workflow. Workflows can be more complicated, so it is important to think twice before implementation start. It is good idea to take a piece of paper and prepare some diagram with all states and all available ways to move item from one to another.