---
schema_version: "1"
id: a62de60a53ec1b0c8e5cf8ee0f242a73dadc3464ee88b9c0ad0e28ab9f7d16b2
title: Validate Visits on Save and Return Warnings from Custom Scripts
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/release-notes/262-0-0/rn_lsc_customer_engagement_execution_visit_script_validation.md
canonical_url: https://help.salesforce.com/s/articleView?id=release-notes.rn_lsc_customer_engagement_execution_visit_script_validation.htm&release=262.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 6e75ee4c0a7fe1d3175c73dfb761ce854e6299aecdc5fd6cec3a74f6c30f075d
description: Give your field teams earlier feedback by extending custom validation scripts to run when users save a visit, not just when they submit or sign. Scripts can now return warnings that let users acknowledge an issue and choose to continue, in addition to errors that block the action. For example, use a custom script to warn users in one market when they approach a visit threshold while preventing users in another market from saving or submitting.
products:
  - Cross Cloud
release: "262"
---
# Validate Visits on Save and Return Warnings from Custom Scripts

Give your field teams earlier feedback by extending custom validation scripts to run when users save a visit, not just when they submit or sign. Scripts can now return warnings that let users acknowledge an issue and choose to continue, in addition to errors that block the action. For example, use a custom script to warn users in one market when they approach a visit threshold while preventing users in another market from saving or submitting.

**Where:** This change is available in:

- Lightning Experience in Enterprise and Unlimited editions with the Life Sciences Cloud license and the Life Sciences Cloud for Customer Engagement add-on license, and where the Life Sciences Cloud for Customer Engagement managed package is installed.
- Life Sciences Cloud mobile app for iOS (iPad only).

**When:** This change is available starting the week of June 22, 2026.

**How:** To take advantage of these enhancements, update your Visit Action Validation custom scripts.

- To validate on save, add `Save` to the list of actions your script checks in the `actionName` environment option. Your script can respond differently to each specific action that triggers validation—`Save`, `Submit`, or `Sign`.
- To warn users without blocking them, return `status: "warning"` in your script results. Users see a confirmation dialog and can choose to continue or cancel.
- If your existing scripts call `runCustomScriptValidations`, you can now remove it. Scripts that include the method continue to work.

#### See Also

- [_Salesforce Help_: Visit Action Validation Scripts](https://help.salesforce.com/s/articleView?id=ind.lsc_custom_scripts_example_visit_action_validation_script.htm&language=en_US)