DIFFERENCE BETWEEN CLIENT SCRIPT SAVE FUNCTION AND USER EVENT BEFORE SUBMIT FUNCTION?
A lot of times validation is required on submit of a record and developers can get confused on whether to use client script save function or user event before submit function to perform the validation. The below points can be used to make an informed decision. TRIGGER POINT: Client script save is triggered only on create, edit and copy. User event before submit is triggered on create, edit, delete, xedit, approve, reject, cancel (SO, ER, Time Bill, PO & RMA only), pack, ship (IF), markcomplete (Call, Task), reassign (Case), editforecast (Opp, Estimate) Also user event before submit has a type parameter to check the trigger type. Client script save function doesn't have any parameter. To check the trigger type in client script, you will need a pageinit function as well which can be used to copy the type to a global variable which can be accessed on save. USER PERMISSION: A client script can triggered only based on the role permis...