lookupErrorCode(insLookupErrorCodeInputRepresentation)

Look up an insurance error code to retrieve its human-readable description, root cause, and step-by-step resolution instructions when a product model validation error is encountered during setup.

API Version

68.0

Requires Chatter

No

Signature

public static ConnectApi.InsLookupErrorCodeRepresentation lookupErrorCode(ConnectApi.InsLookupErrorCodeInputRepresentation insLookupErrorCodeInputRepresentation)

Parameters

insLookupErrorCodeInputRepresentation
Type: ConnectApi.InsLookup​Error​Code​InputRepresentation
Required. Input that specifies the insurance error code string to look up.

Usage

Use this method at design time to resolve an insurance error code such as SF-INS-DSAV-00001. Provide the error code string. The method matches it against registered insurance error codes and returns the description, optional cause, and resolution instructions.

When the error code is known, the response includes the registered description and, when available, localized resolution instructions. When the error code isn’t registered, the method still returns a result with an informative “not found” description and format guidance in instructions.

When required input is missing, errors can include request-level failures such as:

  • SF-INS-DSAV-00040 — the error code wasn’t specified. Provide a valid insurance error code.

Example

This sample looks up an insurance error code from Apex.

ConnectApi.InsLookupErrorCodeInputRepresentation input =
    new ConnectApi.InsLookupErrorCodeInputRepresentation();
input.errorCode = 'SF-INS-DSAV-00029';

ConnectApi.InsLookupErrorCodeRepresentation result =
    ConnectApi.InsuranceDesignAdvisorFamily.lookupErrorCode(input);

System.debug('errorCode=' + result.errorCode);
System.debug('errorDescription=' + result.errorDescription);
System.debug('errorCause=' + result.errorCause);
System.debug('instructions=' + result.instructions);
System.debug('errors=' + result.errors);