Announcement

Collapse
No announcement yet.

Throw error in calculated field formula

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Throw error in calculated field formula

    Is there a way to stop a Before Save Custom Script from successfully saving if a custom validation rule fails? For example:

    Code:
    ifThenElse(
        subType == 'Cell Phone' &&
        (total != 0 && total != 15 && total != 25 && total != 50),
        throw new Error("Total must equal 0, 15, 25, or 50 when subType is 'Cell Phone'")
    )
    That doesn't work, but that's how I want it to work. When the user clicks save, they should be given an error message indicating that the total must equal, 0, 15, 25, or 50 if subType is 'Cell Phone'. Is there a way to do this in a custom save formula or do I have to use a controller method?

  • #2
    There is no way.

    Comment


    • #3
      Thanks

      Comment

      Working...
      X