Skip to main content
All CollectionsTroubleshootingSalesforce validation errors
Resolving validation errors - "Invalid target dialog reference <xxx>"
Resolving validation errors - "Invalid target dialog reference <xxx>"

Cause and solution to this Salesforce validation error

Mateusz Kochanowicz avatar
Written by Mateusz Kochanowicz
Updated over 2 weeks ago

Error overview

User may run into this Salesforce validation error when deploying Einstein Bot versions via BotVersion metadata type.

The returned error would follow below format:
"Invalid target dialog reference: <xxx>" - where <xxx> refers to a specific Dialog_Name.

Example of the error message in Gearset:



Explanation of the error

According to Salesforce's documentation on this issue:

"Winter '20 release (API version 47) introduced a validation in the metadata to require the last Bot Step in a dialog to be one of the following types: WAIT, NAVIGATION (redirection, menus) or SystemMessage (transfer).

If the Last Bot step does not have any of the above, the validation fails with the above error."

---

To fix this, Salesforce was planning to add more flexibility when validating the missing step - by adding WAIT step if no valid step was provided when deploying metadata with API version 47 or lower.

It is unclear if a fix was released, and if it covers scenarios when Gearset users validate their deployment package with API version 47 or above.


Resolution

Current workaround to resolve the issue is to manually update your deployment package to include the last steps as either of the following:

WAIT
NAVIGATION (redirection, menus)
SystemMessage (transfer)

Gearset allows you to download the deployment package (that initially failed the validtion), make the necessary amendments locally (e.g. by using tools like VS Code), and use the edited package as a source of a new deployment in our app.

For guidance on how to download and edit your deployment package, check this article:
How can I change the package XML before deploying

Disclaimer: This error is returned by Salesforce directly, rather than Gearset. Even so, we offer guidance based on our combined experience with the Metadata API. Where possible, we try to help guide you to fix or avoid this error. In the case that this isn't possible, we may need to direct you to Salesforce support for further clarification.

Did this answer your question?