This example expands the query detailed in "JavaScript onDelete Function Example 1: Checking a Single Condition" [ |http://#_bookmark111]by showing how to prevent open activities from being deleted if the parent (Account) is a customer. In this case, deleting records that are open for prospects is allowed, but not for customers. The following assumptions are made in this example:
...
Code Block |
---|
<html><head><title>OnDeleteExample2</title> <script type="text/javascript"> function fieldsOnDelete(){ return "CALTYPE,1.ACCTKW01";} function onDelete(Type,AccountType){ if( Type == 'Call' && AccountType == 'Prospect' ){ window.location = "MELT://showAlert:/ You cannot delete open Call Activities from Prospect Accounts"; return false; }else{ return true; } } </script></head><body></Body></html> |
...