Commerce Server 2007 allows you to extend the different entities in the Catalog and Inventory systems in a straightforward manner. These are the various entities that can be extended
All the above entities except 5 can be extended as follows
The above operations can be performed from the Catalog and Inventory Schema manager. This is how you can perform the above tasks programatically.
Assume that you want to add a VendorId property to track vendors for your product catalogs
/// <summary>
/// Extends the ProductCatalog Entity
/// </summary>
/// <param name="catalogContext"></param>
internal void ExtendCatalogEntity(CatalogContext catalogContext)
{
// Create the property
CatalogProperty property = catalogContext.CreateProperty("VendorId",
CatalogDataType.String, 25);
// Add the property to the ExtensibleEntityType.ProductCatalog entity
catalogContext.AddPropertyToEntity(ExtensibleEntityType.ProductCatalog,
"VendorId");
// Get the properties added to the ExtensibleEntityType.ProductCatalog entity
CatalogPropertiesDataSet extendedProperties =
catalogContext.GetEntityProperties(ExtensibleEntityType.ProductCatalog);
// Iterate through all the extended properties
foreach(CatalogPropertiesDataSet.CatalogProperty extendedProperty in
extendedProperties.CatalogProperties)
string propertyName = extendedProperty.PropertyName;
}
// Now assign a value to the VendorId
ProductCatalog productCatalog = catalogContext.GetCatalog("My Catalog");
productCatalog["VendorId"] = "My Vendor";
// You can also use the Information property to do the same thing
// productCatalog.Information.Catalogs[0]["VendorId"] = "My Vendor";
// save the changes
productCatalog.Save();
string vendorId = null;
// Access the value of the "VendorId" property
// Validate that "VendorId" property has been added to the ProductCatalog
// entity and its value is not null
if ( productCatalog.HasProperty("VendorId")
&& !productCatalog.IsPropertyNull("VendorId"))
vendorId = (string)productCatalog["VendorId"];
// vendorId = (string)productCatalog.Information.Catalogs[0]["VendorId"];
// Remove the property from the ProductCatalog entity
catalogContext.RemovePropertyFromEntity(ExtensibleEntityType.ProductCatalog,
In a similar manner you can extend the other entities. Use