Showing posts with label Sitecore Commerce Server. Show all posts
Showing posts with label Sitecore Commerce Server. Show all posts

Tuesday, 20 September 2016

Sitecore Commerce Server Manager : Profile Definition 404 Error

5 comments
I’ve been working with Sitecore commerce server manager for a while and recently I have stuck with one error related to Sitecore commerce server manager. I was unable to navigate through Profile Definitions in commerce server manager. I was getting HTTP 404 The webpage cannot be found error.


I’ve checked stack trace in fiddler and found out that http://<server-name>/widgets/profilebldrHTC/ProfileEdit.htm was throwing 404 error.


It seems that Sitecore Commerce Server creates virtual folder named Widgets in the IIS default website. This virtual folder points to C:\Program Files (x86)\Commerce Server 11\Widgets directory.

Follow below steps to resolve the 404 issue:
  1. Open IIS.
  2. Navigate to default website in IIS.
  3. Right click on default website and click Add Virtual Directory.
  4. Enter Widgets in Alias section. 
  5. Enter physical path as C:\Program Files (x86)\Commerce Server 11\Widgets
  6. Click OK.
  7.  Restart default website and refresh Sitecore commerce server manager. 404 error should have been gone now.
Comments and suggestions are most welcome. Happy coding!
Read More...

Sunday, 15 May 2016

Error : HTTPS connection is required for Orders and Profiles webservices

3 comments
I've been working with Sitecore Commerce 8 powered by Commerce Server now for a while and trying to configure the demo store which is based upon Reference Storefront solution provided by Sitecore commerce product team.  I’ve successfully managed to get the demo store running but I have faced below error while opening Commerce Server Customer and Orders Manager business tool:
HTTPS connection is required for Orders and Profiles webservices. 
By default the Commerce Server Customer and Orders Manager business tool requires that the connections to the Orders and Profiles web services should be over HTTPS. This behaviour can be changed to allow it to work over HTTP instead.  However HTTP connection configuration is not recommended for LIVE or PRODUCTION environment as you should always use HTTPS to ensure data is secure but HTTP connection can be useful in development and test scenarios where HTTPS communications are not easily available.

Follow below steps so that Commerce Server Customer and Orders Manager business tool allow HTTP for connectivity to the Profile and Orders web services:
  1. Navigate to C:\Program Files (x86)\Commerce Server 11\Business User Applications directory.
  2. Open the file CustomerandOrdersManager.exe.config in notepad.
  3. Search for below entry under <applicationsettings> section.
    <setting name="AllowHTTP" serializeAs="String">
                    <value>False</value>
    </setting>
  4. Change this entry as shown below:
     <setting name="AllowHTTP" serializeAs="String">
                    <value>True</value>
    </setting>
  5. Save the config file.
  6. Restart IIS or recycle application pool of profiles web service.
  7. Open Commerce Server Customer and Orders Manager business tool and enter standard HTTP connection strings for the Orders and Profiles Web Services URLs in Site Connections window.


Comments and suggestions are most welcome. Happy coding! 
Read More...

Monday, 15 February 2016

Commerce Server Error : The requested profile could not be retrieved

1 comment
I've been working with Sitecore Commerce 8 powered by Commerce Server now for a while and trying to configure the demo store which is based upon Reference Storefront solution provided by Sitecore commerce product team.  I’ve successfully managed to get the demo store running after following configuration steps however I’d faced few issues while setting it up. In my upcoming blog posts I’ll be sharing my learning on some troubleshooting I went through.

I was trying to create a user account in demo storefront website. I got below error once I clicked on create user button after entering relevant details in create an account form.   
Register: The requested profile could not be retrieved because the key name provided does not exist or is not an indexed property. The profile type is 'UserObject'. The key name provided is ‘GeneralInfo.ExternallD’.
In order to resolve above issue, I did following steps:
  1. Verify that profile schema is correct. If profile schema is incorrect then import profile schema again.
  2. After importing schema, modify Sitecore Commerce 8.0 powered by Commerce Server Profile Schema for Sitecore Integration as described here.
  3. I have found that profile database schema was not correct and u_external_id column was missing in UserObject table of profile database.
  4. Make the following changes in UserObject table of profile database:
    Add column: u_external_id NVARCHAR(256) NOT NULL
    IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'userobject' AND COLUMN_NAME = 'u_external_id')
    BEGIN
     ALTER TABLE dbo.UserObject ADD u_external_id nvarchar(256) NOT NULL
    END
    GO
    
    Create Index on: u_external_id, UNIQUE NONCLUSTERED INDEX and ASC
    IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[UserObject]') AND name = N'IX_UserObject_ExternalId')
     DROP INDEX [IX_UserObject_ExternalId] ON [dbo].[UserObject]
    GO
    
    IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[UserObject]') AND name = N'IX_UserObject_ExternalId')
    CREATE UNIQUE NONCLUSTERED INDEX [IX_UserObject_ExternalId] ON [dbo].[UserObject]
    (
     [u_external_id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    
  5. Update Sitecore Commerce 8.0 powered by Commerce Server Profile Schema. Add a new GeneralInfo.ExternalId profile property that maps to the external id column, it must be required and unique. This blog explains how to add new property to user object in commerce server profile system.
  6. Refresh the cache and reload the register account page. You should no longer get the above error message and should be able to create new user account in demo storefront website.
Comments and suggestions are most welcome. Happy coding!  
Read More...

Commerce Server : How to add a Property to a Profile Definition

4 comments
In this blog post I am going to explain how to add a new Property to a Profile Definition in Sitecore Commerce Server. For example, I’ll show how to add a new property ExternalId to User object into Profile Definition of Sitecore Commerce Server.

Add new column in SQL Server table
  1. Make the following changes in UserObject table of profile database in SQL server:
    Add column: u_external_id NVARCHAR(256) NOT NULL
IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'userobject' AND COLUMN_NAME = 'u_external_id')
BEGIN
 ALTER TABLE dbo.UserObject ADD u_external_id nvarchar(256) NOT NULL
END
GO
Create new Data member in Commerce Server Manager
  1. Open Commerce Server Manager. Expand Commerce Server Manager -> Global Resources -> Profiles -> Profile Catalog -> Data Sources -> ProfileService_SQLSource -> Data Objects. Right click the data object you want to add a data member to, and then click New Data Member. I am going to add new data member to User object.
  2. In the New Data Member dialog box, complete below fields:
    Field NameDetails
    Member NameSelect an available data member name from the list. Data members which have already been added to a data object will be unavailable for selection and appear dimmed. The member name must match the name of the column to which the data member maps in SQL server table. The member name can contain a maximum of 127 alphanumeric characters and the underscore (_) symbol. The member name cannot contain spaces.
    Display NameType a display name that contains a maximum of 127 Unicode characters.
    DescriptionType a description for the data member. The description can contain a maximum of 127 Unicode characters.
    TypeSelect the appropriate data type for the data member. The data type must be the same as the property that you will map with the data member.
    Multi-valuedSelect this option to enable the collection of multiple values that are associated with the data member.
    RequiredSpecifies that this property is required on your Web site. However, the Profiles Schema Manager does not enforce this attribute.
    IndexedSelect this option if you want the data indexed on this data member.
    Primary keySelect this option to designate this data member as the primary key. You must select one data member in each data object to be the primary key.
  3. Click Add. The data member appears in the data member list in the New Data Member dialog box.
  4. Click Finished.
Map the data member to a property in profile object.
  1. Open Commerce Server Manager. Expand Commerce Server Manager -> Global Resources -> Profiles -> Profile Catalog -> Profile Definitions. Left click the profile definition object where you want to add a new property. I’ve selected User object profile definition.
  2. Select appropriate information group and then click on Add to add new property.
  3. The property will be appeared in general information group with a new name called New Property 1.
  4. Select New Property 1. You can see a property editor in the right hand section.
  5. Fill the fields in Attributes section. 
  6. Fill the fields in Advanced attributes section. Click on Map to data to map the newly created data member to new property.
  7. Fill the fields in Custom attributes section as per requirement.
  8. Click on apply to save the changes of new property. Now the new property is added to User object.
Comments and suggestions are most welcome. Happy coding!
Read More...