Code to Stage Products and Catalogs by Time

Normally, catalog data is visible to your users as soon as it is placed in the Product Catalog System. It is possible to automatically activate products in a catalog at a predetermined time or date by adding an additional property and then filtering on that property. A similar technique can be used to deactivate products in the Product Catalog System.

The following steps show how to stage products and catalogs by time:

  1. Define a new property of type Date and call it AvailableFrom. Set the AssignToAll attribute to True and the DisplayOnSite attribute to False.

  2. When creating or editing products, you can specify a value for the AvailableFrom property that indicates the date and time that the product should become visible on your Web site.

  3. Filter any recordsets of products, such as those returned from the Category.Products, CatalogManager.Query, CatalogManager.FreeTextSearch, ProductCatalog.GuaranteedSpecificationSearch, or ProductCatalog.PerformSpecificationSearch methods by specifying an ActiveX Data Objects (ADO) filter on the recordset as "AvailableFrom<=NOW". (Where NOW must be replaced by the current date and time, appropriately formatted.)

    For example, where you have code like:

    rsProducts = oCatalog.GetCategory(strCategoryName).Products
    

    You need to follow it with:

    rsProducts.filter = "AvailableFrom <= " & format(Date, General Date)
    

    This prevents products from being visible on your Web site until the date and time specified.

Ee784616.note(en-US,CS.20).gifNote

  • Caching of HTML might prevent products from appearing on your Web site until the cache is flushed.

Copyright © 2005 Microsoft Corporation.
All rights reserved.