---
title: "switchTo Method"
canonical: https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.objectmodel.product.switchto.htm
archived: true
applies_to:
  - product: "Customer's Canvas On-Premises"
  - product: "Design Editor"
    versions: ["6.15.0", "6.x (may differ)"]
---

**You’re viewing outdated documentation.** [View the latest Customer’s Canvas On-Premises documentation](https://customerscanvas.com/docs/on-premises/).

# switchTo Method

**Applies to:** Customer's Canvas On-Premises; Design Editor 6.15.0, 6.x (may differ) · **Archived documentation**
 
### Callable
 
- switchTo(surface:  [Surface](https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.objectmodel.surface.htm.md) ) :  Promise &lt; [Product](https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.objectmodel.product.htm.md) &gt;

- Opens the given product surface in the designer. Returns the product with the given surface (page) opened.
  
 - example
     - ```
    editor.getProduct()
        .then(function (product) {
            // Get the current surface index.
            const indexOfCurrentSurface = product.surfaces.lastIndexOf(product.currentSurface);
            if (indexOfCurrentSurface < 0)
                throw "Surface not found!";
    
            let indexOfNextSurface = indexOfCurrentSurface + 1;
            if (indexOfNextSurface > (product.surfaces.length - 1))
                indexOfNextSurface = 0;
    
            // Switch to the next surface.
            return product.switchTo(product.surfaces[indexOfNextSurface]);
        })
        .then(function(result) {
            console.log("Surface switched");
        })
        .catch(function (error) {
            console.error("Switching the surfaces failed with exception: ", error);
        });
    ```

#### Parameters

    - ##### surface: [Surface](https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.objectmodel.surface.htm.md) 
  
        A surface (page) to open.

#### Returns Promise &lt; Product &gt;
 
    The product with the given surface (page) opened.
