Creating dynamic selections

You can create a dynamic selection. When choosing a dynamic selection, you receive an updated search result every time you run the selection

Before you begin

Ensure that you have the information about the type of selection that you would like to create.

About this task

Dynamic selections are useful for getting the updated search results. For example, you might want to create a dynamic selection to retrieve the updated sales results of cars for the current month when you run the dynamic selection.

Procedure

  1. Create the selection. Use any one of the following methods: user interface, Java™ API, or script API.
    Option Description
    User interface
    1. Click Product Manager > Catalogs > Catalog Console..
    2. Choose a catalog.
    3. Click Rich Search.
    4. Provide the required details.
    5. From the Save search as field, select Dynamic Selection.
    6. Provide a name for the selection.
    7. Provide the search criteria.
    8. Click Search.
    Note: You can edit items in dynamic selections by navigating to Product Manager > Selections > Selection Console. Click on the icon for Preview this selection . After you select an item that you want to edit in a dynamic selection, you must click Edit Selected at the top of the page instead of Edit at the extreme right of a row. This will enable you to save any changes you make to the item.
    Java API The following sample Java API code creates a dynamic selection.
    Context ctx = PIMContextFactory.getCurrentContext();
    		SelectionManager mgr = ctx.getSelectionmanager();
    		DynamicSelection sel = mgr.createDynamicSelection("my dynamic selection", " select item.pk from 
    catalog('my catalog') where item['myspec/myattribute'] = 'abc' ");
    		sel.save();
    Script API The following sample script creates a dynamic selection.
    var ctg = getCtgByName("my catalog");
    		var sel = new DynamicSelection("my dynamic selection", " select item.pk from catalog('my catalog') where item['myspec/myattribute'] = 'abc' ");
    		sel.saveSelection();
    The selection is created, users can view it in the Selection console.
  2. Optional: Run the an dynamic selection.