---
schema_version: "1"
id: c381be16b533019f9788f47279d240319b661b9144a66ce1ab826c686cce1491
title: validateProductDiscovery(insProductDiscoveryValidationInputRepresentation)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/insurance_developer_guide/apex_ConnectAPI_InsuranceDesignAdvisorFamily_validateProductDiscovery_1.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_ConnectAPI_InsuranceDesignAdvisorFamily_validateProductDiscovery_1.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 54cf69bf2ce69293bc82cb8d4357f3926466d7fbba5de7c33baf07201c386367
description: Validate that a product is discoverable at runtime by checking price book entries, selling models, pricing procedures, and decision table configurations.
---
# validateProductDiscovery(insProductDiscoveryValidationInputRepresentation)

Validate that a product is discoverable at runtime by checking price book entries, selling models, pricing procedures, and decision table configurations.

## API Version

68.0

## Requires Chatter

No

## Signature

public static ConnectApi.InsProductDiscoveryValidationRepresentation validateProductDiscovery(ConnectApi.InsProductDiscoveryValidationInputRepresentation insProductDiscoveryValidationInputRepresentation)

## Parameters

insProductDiscoveryValidationInputRepresentation

Type: [ConnectApi.InsProduct​Discovery​Validation​InputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_input_ins_product_discovery_validation.htm "Input representation of the product to validate for discovery setup. Identify the product by ID, product code, or developer name.")

Required. Input that identifies the insurance product to validate for discovery setup. Provide at least one of product ID, product code, or developer name.

## Return Value

Type: [ConnectApi.InsProduct​Discovery​Validation​Representation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_output_ins_product_discovery_validation.htm "Output representation of the product discovery validation result, including whether the product’s discovery setup is valid and any related errors or informational messages.")

## Usage

Use this method at design time to confirm that a product’s discovery-related setup is correct before runtime product discovery. The method resolves the target product from the provided identifier and validates pricing, price book entries, and selling model configurations that would otherwise surface as failures during discovery.

Validations include confirming that at least one product identifier is provided; that the product exists; that an active price book entry with a unit price greater than zero is associated with an active price book; and that the product is associated with an active product selling model option. When the Select Pricing Procedure preference is enabled, the method also checks that a product discovery pricing procedure is configured with an active version, that an active decision table with source object PricebookEntry exists, and that the product’s price book entry can be resolved by that decision table.

When the discovery setup is valid, isValid is true. When setup fails, isValid is false and errors lists the failures. Examples include:

- SF-INS-DSAV-00038 — no product identifier was provided.
- SF-INS-DSAV-00044 — no product was found for the specified identifier.
- SF-INS-DSAV-00011 — the product doesn’t have a price book entry.
- SF-INS-DSAV-00004 — the product isn’t associated with a product selling model option.
- SF-INS-DSAV-00040 — the product discovery pricing procedure isn’t configured.
- SF-INS-DSAV-00047 — no active decision table with source object PricebookEntry was found.

Informational messages can appear in infos. For example, SF-INS-DSAV-00042 indicates that pricing is disabled for product discovery and pricing procedure validation was skipped, and SF-INS-DSAV-00043 reminds you to refresh decision tables after recent changes.

## Example

This sample validates product discovery setup from Apex.

ConnectApi.InsProductDiscoveryValidationInputRepresentation input =
    new ConnectApi.InsProductDiscoveryValidationInputRepresentation();
input.productId = '01txx0000006i3DAAQ';

ConnectApi.InsProductDiscoveryValidationRepresentation result =
    ConnectApi.InsuranceDesignAdvisorFamily.validateProductDiscovery(input);

System.debug('isValid=' + result.isValid);
System.debug('errors=' + result.errors);
System.debug('infos=' + result.infos);