Is there a way to stop a Before Save Custom Script from successfully saving if a custom validation rule fails? For example:
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?
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'") )
Comment